SyncOptions
Options that affect how the PowerSync SDK connects to the PowerSync Service.
Properties
| Property | Type | Description |
|---|---|---|
appMetadata? | Record<string, string> | A set of metadata to be included in service logs. |
checkpointMode? | CheckpointMode | The mode used to request checkpoints from the service (used after uploading local data). |
connectionMethod? | SyncStreamConnectionMethod | The connection method to use when streaming updates from the PowerSync backend instance. The default value is SDK-specific. SyncStreamConnectionMethod.HTTP is the preferred implementation and used by default, except for React Native apps without Expo. Those don't support streaming HTTP responses, which is why SyncStreamConnectionMethod.WEB_SOCKET is used as a workaround. |
connectTimeoutMs? | number | How long to wait for the PowerSync Service to respond, in milliseconds. This defaults to 30 seconds. For checkpoint requests, this limits the whole request. For the sync stream over HTTP, this limits the time until the response starts, not how long the stream stays open. WebSocket connections use their own timeouts. A request that takes longer fails and is retried after SyncOptions.retryDelayMs. |
crudUploadThrottleMs? | number | Backend Connector CRUD operations are throttled to occur at most every crudUploadThrottleMs milliseconds. |
diagnostics? | boolean | Enables the core extension's diagnostics event stream: detailed per-bucket download stats, including each bucket's target_count, and inferred column types. Off by default. The events are internal. No public API exposes them; only PowerSync DevTools reads them, to show per-bucket totals. See https://docs.powersync.com/tools/devtools-overview. |
fetchStrategy? | FetchStrategy | - |
includeDefaultStreams? | boolean | Whether to include streams that have auto_subscribe: true in their definition. This defaults to true. |
params? | Record<string, JSONValue> | These parameters are passed to the sync rules, and will be available under theuser_parameters object. |
retryDelayMs? | number | Delay for retrying sync streaming operations from the PowerSync backend after an error occurs. |