enableRealtimeSync property
Enable real-time synchronization via WebSocket.
Default: false
When enabled, changes from other devices will be synced instantly instead of waiting for the polling interval. Requires a WebSocket server that implements the SyncLayer real-time protocol.
Benefits:
- Instant updates across devices
- Better battery life (30-50% savings vs polling)
- Less bandwidth usage (80-90% savings)
- Enables collaborative features
Example:
SyncConfig(
baseUrl: 'https://api.example.com',
enableRealtimeSync: true,
websocketUrl: 'wss://api.example.com/ws',
collections: ['todos', 'users'],
)
Implementation
final bool enableRealtimeSync;