@quantabit/sync-sdk
v1.0.2
Published
QuantaBit Data Sync SDK - Offline caching, multi-device sync, conflict resolution, and incremental updates
Maintainers
Readme
@quantabit/sync-sdk
QuantaBit Data Sync SDK - Offline caching, multi-device sync, conflict resolution, and incremental updates
📦 Installation
npm install @quantabit/sync-sdk
# or
yarn add @quantabit/sync-sdk🚀 Quick Start
API Client
import { syncApi } from "@quantabit/sync-sdk";
// Configure sync
syncApi.configure({
apiUrl: "https://api.example.com/v1/sync",
token: "your-auth-token",
});
// Push local changes to server
await syncApi.push({ type: "settings", data: localSettings });
// Pull latest data from server
const serverData = await syncApi.pull("settings");
// Full sync (bidirectional)
const result = await syncApi.sync({
collections: ["settings", "favorites", "history"],
strategy: "last-write-wins",
});
// Get sync status
const status = await syncApi.getStatus();📖 API Reference
| Method | Description |
| ------ | ----------- |
| syncApi.configure(options) | Configure sync settings |
| syncApi.push(data) | Push local data to server |
| syncApi.pull(collection) | Pull server data |
| syncApi.sync(options) | Bidirectional sync |
| syncApi.getStatus() | Get sync status |
| syncApi.setConflictResolver(fn) | Custom conflict resolution |
📄 License
MIT License
🌐 Brand & Links
- Official Mainnet: QuantaBit Chain
- Developer Platform: Developer Platform
- Open Platform: Open Platform
- Payment Platform: Pay Platform
- Feedback: Feedback
