Skip to content

SubscriptionClientOptions

Defined in: packages/client/src/circuits/subscription-client.ts:63

optional authHeaders?: () => Record<string, string> | Promise<Record<string, string>>

Defined in: packages/client/src/circuits/subscription-client.ts:74

The caller’s own auth headers, resolved per request.

The SAME adapter the write path uses (ADR-0003): read and write authorization must not diverge, and a JWT that refreshed for one has refreshed for both.

Record<string, string> | Promise<Record<string, string>>


controlPlaneUrl: string

Defined in: packages/client/src/circuits/subscription-client.ts:65

Base URL of the control plane — the pgxsinkit server.


optional fetch?: typeof fetch

Defined in: packages/client/src/circuits/subscription-client.ts:90


optional onRevoked?: (revoked) => void

Defined in: packages/client/src/circuits/subscription-client.ts:81

Called when a scope is revoked. The subscriber truncates that scope and unsubscribes.

RefusedStream[]

void


optional refreshSkewSeconds?: number

Defined in: packages/client/src/circuits/subscription-client.ts:79

Re-mint this many seconds before the token expires. Default 60 — comfortably inside ADR-0055’s 5-minute default lifetime, and large enough that a slow round trip does not race the expiry.


optional signal?: AbortSignal

Defined in: packages/client/src/circuits/subscription-client.ts:89

Aborts in-flight control-plane requests on teardown.

Load-bearing rather than tidy: a client stopped while its control plane is unreachable has a subscribe sitting on a TCP connect that can take minutes to fail, and stop() waits for the boot tail. Without this, teardown is held hostage by a network that is already gone.


streamBaseUrl: string

Defined in: packages/client/src/circuits/subscription-client.ts:67

Base URL the edge serves streams from. streamPath is appended to it.