Strata Storage Examples
This directory contains practical examples demonstrating how to use Strata Storage in various scenarios.
Basic Examples
- Basic Usage - Simple get/set operations
- Configuration - Various configuration options
- Error Handling - Handling storage errors
Feature Examples
- Encryption - Secure data storage
- Compression - Data compression examples
- TTL/Expiration - Auto-expiring data
- Cross-Tab Sync - Multi-tab synchronization
- Queries - Advanced data queries
- Migrations - Data migration examples
Platform Examples
- Web Application - Browser-based usage
- React Native - Package support boundary and alternatives
- Capacitor App - Capacitor plugin usage
- Ionic Application - Ionic framework integration
Framework Examples
- React Hooks - Using React integration
- Vue Composables - Vue 3 integration
- Angular Services - Angular integration
Advanced Examples
- Multi-Storage - Using multiple storage types
- Performance Optimization - Optimizing for speed
- Offline Support - Building offline-first apps
- Data Synchronization - Syncing with backend
Real-World Examples
- User Authentication - Server-owned sessions and local UI state
- Shopping Cart - E-commerce cart management
- Form Data Persistence - Saving form progress
- Cache Management - API response caching
- Analytics Tracking - Storing analytics data
Running Examples
Some pages show complete snippets; others show one part of an application flow and need your own data, server or framework setup. Start with the verified browser round-trip:
import { defineStorage } from 'strata-storage';
const storage = defineStorage();
await storage.set('draft', 'First pass');
const draft = await storage.get<string>('draft');
For complete applications, see the example apps in the repository.