Creates an offline-capable NonLocalStorage instance. Synchronizes local changes with remote storage when online, and queues changes for later sync when offline. Provides a unified API for item management, event handling, and connection state.
Credentials for remote storage access.
Optional
Either a string ID or an OfflineSyncOptions object.
A promise that resolves to a NonLocalStorage instance.
const nls = await createOfflineNonLocalStorage({ projectId: 'myProject' }, { ttl: 60000 });await nls.setItem('key', 'value');const value = await nls.getItem('key'); Copy
const nls = await createOfflineNonLocalStorage({ projectId: 'myProject' }, { ttl: 60000 });await nls.setItem('key', 'value');const value = await nls.getItem('key');
Creates an offline-capable NonLocalStorage instance. Synchronizes local changes with remote storage when online, and queues changes for later sync when offline. Provides a unified API for item management, event handling, and connection state.