Skip to main content

Interface: StackSyncOptions

Defined in: packages/client/src/core/sync/index.ts:62

Options for ClientStack.sync.

Everything except remote has a working default; the defaults describe a continuous, self-healing, internal-documents-excluded sync.

Properties

PropertyTypeDescriptionDefined in
batchesLimit?numberConcurrent batches. Passed to PouchDB as batches_limit.packages/client/src/core/sync/index.ts:74
batchSize?numberDocuments per batch. Passed to PouchDB as batch_size.packages/client/src/core/sync/index.ts:72
checkSchemaVersion?booleanRefuse to start when the remote was last written by a newer schema. Defaults to true. See SyncSchemaMismatchError.packages/client/src/core/sync/index.ts:111
classes?ClassFilterOptionsWhich classes replicate. See ClassFilterOptions - an allow-list keeps the data model automatically, and relations are judged by their endpoints. Example stack.sync({ remote, classes: { exclude: ["Draft"] } });packages/client/src/core/sync/index.ts:88
direction?SyncDirectionDirection of travel. Defaults to "both".packages/client/src/core/sync/index.ts:66
filter?(doc) => booleanAn extra predicate, ANDed with the filters above. Return true to replicate the document. Must be pure - PouchDB calls it once per change. Prefer classes where it fits: a bare function has no configuration DocStack can see, so its identity for checkpointing purposes is its own source text. Two closures over different data with the same source read as the same filter, and replication resumes where the other one left off. Build a fresh function whose source differs, or use classes.packages/client/src/core/sync/index.ts:99
heartbeat?number | falseChanges-feed heartbeat, in milliseconds, or false to disable.packages/client/src/core/sync/index.ts:76
internalDocs?false | InternalDocFilterOptionsWhich of DocStack's own documents to keep on this device, or false to replicate everything including ~system. false is for stack-to-stack mirroring of a whole database and is otherwise a bad idea. Defaults to InternalDocFilterOptions' own defaults.packages/client/src/core/sync/index.ts:106
live?booleanKeep replicating as changes happen. Defaults to true.packages/client/src/core/sync/index.ts:68
remoteRemoteResolverThe remote to replicate against. See RemoteResolver.packages/client/src/core/sync/index.ts:64
retry?booleanRetry on transient failure with PouchDB's backoff. Defaults to true.packages/client/src/core/sync/index.ts:70
timeout?number | falseChanges-feed timeout, in milliseconds, or false to disable.packages/client/src/core/sync/index.ts:78