SDK Reference
Methods
Get Started
Core concepts
SDK Reference
Database
Troubleshooting
Who's using PocketSync
SDK Reference
Methods
Methods for PocketSync
PocketSync
initialize
final pocketSync = await PocketSync.initialize(
options: PocketSyncOptions(
projectId: 'your-project-id',
authToken: 'your-auth-token',
serverUrl: 'https://api.pocketsync.dev',
changeLogRetentionDays: 30,
syncExistingData: true,
conflictResolutionStrategy: ConflictResolutionStrategy.lastWriteWins,
customResolver: null,
verbose: false,
),
dbPath: dbPath,
databaseOptions: databaseOptions,
);
setUserId
await PocketSync.instance.setUserId(userId: 'user-123');
Start sync
await PocketSync.instance.start();
Force sync
await PocketSync.instance.scheduleSync();
Stop sync
await PocketSync.instance.stop();
Reset change tracking
await PocketSync.instance.reset();