CreateSyncServerOptions
Defined in: packages/server/src/index.ts:69
Type Parameters
Section titled “Type Parameters”TRegistry
Section titled “TRegistry”TRegistry extends SyncTableRegistry
TDb extends PgAsyncDatabase<PgQueryResultHKT, RegistryRelations<TRegistry>> = PgAsyncDatabase<PgQueryResultHKT, RegistryRelations<TRegistry>>
Properties
Section titled “Properties”allowedOrigins?
Section titled “allowedOrigins?”
optionalallowedOrigins?:string[]
Defined in: packages/server/src/index.ts:97
applyFunctionGrantExecuteTo?
Section titled “applyFunctionGrantExecuteTo?”
optionalapplyFunctionGrantExecuteTo?: readonlystring[]
Defined in: packages/server/src/index.ts:143
The roles the INSTALLED apply function was generated with (pgxsinkit-generate --grant-execute-to <role>, ADR-0054). Default [] — owner-only, the default the CLI generates.
It is not a grant this server performs; it is how the server reproduces the artifact’s ADR-0018
fingerprint, which hashes the ACL along with the rest of the body. Generate with a grant and leave
this unset and every write fails PXS01 (stale artifact) — so the two lists must stay identical.
applyFunctionSchema?
Section titled “applyFunctionSchema?”
optionalapplyFunctionSchema?:string
Defined in: packages/server/src/index.ts:156
The schema the INSTALLED apply function lives in (pgxsinkit-generate --function-schema <schema>).
Default: unset — the artifact is generated unqualified and resolved through the connection’s
search_path.
It does two things at once, which is why one option drives both: the schema is part of the
fingerprinted body (the function names itself in its own self-check), AND it is how this server
QUALIFIES the call. Generate with --function-schema and leave this unset and the call goes out
unqualified — which either finds nothing (42883) or, worse, finds a same-named function elsewhere
on the search_path that then fails PXS01 against a fingerprint it does not carry. The two must
name the same schema.
db:
TDb
Defined in: packages/server/src/index.ts:77
deployment?
Section titled “deployment?”
optionaldeployment?:DeploymentProfile
Defined in: packages/server/src/index.ts:105
The startup query posture (ADR-0030). The apply function now verifies its own ADR-0018 fingerprint
in-body on every call (SQLSTATE PXS01 on drift), so there is no startup drift check to configure;
this governs only the RLS auth-helper verify and the operations-log presence resolution. Defaults
are the safe degradation posture (ADR-0030). See DeploymentProfile.
electricUrl?
Section titled “electricUrl?”
optionalelectricUrl?:string
Defined in: packages/server/src/index.ts:84
When set, the server serves a read-path Electric shape proxy that shares the
single resolveAuthClaims adapter with the write path (ADR-0003). Without it,
no shape proxy is registered.
eventGate?
Section titled “eventGate?”
optionaleventGate?:EventGate
Defined in: packages/server/src/index.ts:112
The Event lane’s consent/entitlement gate (ADR-0053 decision 1): the lane’s one function, and so an
option here rather than a registry field (the registry stays declarative data only). Called once per
event, after its payload validated and its identity resolved, and before anything is enqueued; a refusal
is a per-event refused verdict. Absent → every well-formed event is allowed. See EventGate.
eventQueue?
Section titled “eventQueue?”
optionaleventQueue?:EventQueue
Defined in: packages/server/src/index.ts:127
The Event lane’s queue backend. Defaults to the shipped pgmq backend over this server’s own db
(createPgmqEventQueue), which is what makes an enqueue join the endpoint’s transaction. Override it to
run the lane on another backend, or to substitute a fake in tests.
healthCheck?
Section titled “healthCheck?”
optionalhealthCheck?:boolean| {path:string; }
Defined in: packages/server/src/index.ts:93
Health check endpoint. Enabled by default at /health; false disables it, { path } relocates it.
optionalhost?:string
Defined in: packages/server/src/index.ts:95
idleTimeoutSeconds?
Section titled “idleTimeoutSeconds?”
optionalidleTimeoutSeconds?:number
Defined in: packages/server/src/index.ts:96
logTimings?
Section titled “logTimings?”
optionallogTimings?:boolean
Defined in: packages/server/src/index.ts:134
Opt-in per-request timing log (default false). When on, each mutation and shape-proxy request emits
one compact [pgxsinkit-timing] line with an ISO-8601(ms, UTC) timestamp and phase durations, for
attributing wall-clock latency against the client’s syncDebug lines. Off by default — a pure
diagnostic surface that adds no standing query or latency when unset.
onEventsEnqueued?
Section titled “onEventsEnqueued?”
optionalonEventsEnqueued?:EventsEnqueuedHook
Defined in: packages/server/src/index.ts:121
Fired after an ingest request ENQUEUED at least one sub-batch (ADR-0053 amendment, 2026-08-02): the
deployment-agnostic seam a SERVERLESS deployment uses to nudge whatever endpoint runs the consumer’s
drainOnce(), so an interactive append drains in milliseconds instead of waiting for the next
scheduled tick. Fire-and-forget — it is called after the commit, its throw is caught and warn-logged,
and the scheduled sweep (not the nudge) is the delivery guarantee. Absent → nothing is nudged, which is
right for a deployment hosting the long-lived runner. See EventsEnqueuedHook.
onStatusChange?
Section titled “onStatusChange?”
optionalonStatusChange?: (status) =>void
Defined in: packages/server/src/index.ts:98
Parameters
Section titled “Parameters”status
Section titled “status”SyncRuntimeStatus
Returns
Section titled “Returns”void
operationsLog?
Section titled “operationsLog?”
optionaloperationsLog?:object
Defined in: packages/server/src/index.ts:89
enabled?
Section titled “enabled?”
optionalenabled?:boolean
optionalport?:number
Defined in: packages/server/src/index.ts:94
registry
Section titled “registry”registry:
TRegistry
Defined in: packages/server/src/index.ts:76
resolveAuthClaims?
Section titled “resolveAuthClaims?”
optionalresolveAuthClaims?: (request) => {[key:string]:unknown;app_metadata?: {[key:string]:unknown;roles?:string[]; };sub?:string; } |Promise<{[key:string]:unknown;app_metadata?: {[key:string]:unknown;roles?:string[]; };sub?:string; } |null> |null
Defined in: packages/server/src/index.ts:78
Parameters
Section titled “Parameters”request
Section titled “request”Request
Returns
Section titled “Returns”{[key: string]: unknown; app_metadata?: {[key: string]: unknown; roles?: string[]; }; sub?: string; } | Promise<{[key: string]: unknown; app_metadata?: {[key: string]: unknown; roles?: string[]; }; sub?: string; } | null> | null
resolveShapeParams?
Section titled “resolveShapeParams?”
optionalresolveShapeParams?: (request) =>Record<string,unknown> |undefined
Defined in: packages/server/src/index.ts:88
Optional per-request extra params passed to customWhere/shared filters.
Parameters
Section titled “Parameters”request
Section titled “request”Request
Returns
Section titled “Returns”Record<string, unknown> | undefined
shapeProxyPath?
Section titled “shapeProxyPath?”
optionalshapeProxyPath?:string
Defined in: packages/server/src/index.ts:86
Path for the shape proxy route. Defaults to /api/shape.