@edgebasejs/client-core
v0.1.12
Published
EdgeBase platform-agnostic client core
Downloads
56
Readme
@edgebasejs/client-core
Core client SDK for EdgeBase. Provides sync engine, auth manager, outbox, and storage abstraction.
Install
pnpm add @edgebasejs/client-coreWhat it provides
AuthManagerfor login/register/token refreshClientSyncEnginefor offline-first syncOutboxManagerfor queued mutations- Storage adapters (
MemoryStorageAdapter, and interface for custom storage)
Usage
import {
AuthManager,
ClientSyncEngine,
OutboxManager,
MemoryStorageAdapter,
} from '@edgebasejs/client-core';
const storage = new MemoryStorageAdapter();
const auth = new AuthManager({ apiUrl, storage });
await auth.init();
const outbox = new OutboxManager(storage);
await outbox.init();
const sync = new ClientSyncEngine({
apiUrl,
accessToken: auth.getAccessToken() || '',
storage,
outboxManager: outbox,
});
await sync.init();Notes
Use @edgebasejs/react-native for the full React Native integration.
