Skip to content

StreamSourceOptions

Defined in: packages/client/src/circuits/stream-source.ts:33

optional fetch?: typeof fetch

Defined in: packages/client/src/circuits/stream-source.ts:58


optional live?: boolean

Defined in: packages/client/src/circuits/stream-source.ts:56

Long-poll the tail after catching up. false reads to the tail and stops.


optional offset?: string

Defined in: packages/client/src/circuits/stream-source.ts:37

Where to resume. STREAM_START for a new subscription.


optional onTokenRejected?: (status) => string | Promise<string | null> | null

Defined in: packages/client/src/circuits/stream-source.ts:54

Called when the edge rejects the current token (401/403). Return a fresh token to retry once with it, or null to stop.

Returning null is the right answer for a revoked entitlement, and the reason this hook exists at all rather than a blanket retry — see createTokenRecovery.

number

string | Promise<string | null> | null


optional signal?: AbortSignal

Defined in: packages/client/src/circuits/stream-source.ts:57


token: () => string | Promise<string>

Defined in: packages/client/src/circuits/stream-source.ts:46

The current stream token, re-resolved on every request rather than captured once.

A live subscription outlives its token by design — the ADR-0055 default lifetime is five minutes and a subscription runs for hours — so a token frozen at open would 403 the whole stream at the first TTL boundary. This is the ADR-0013 read-path refresh seam. A token that cannot be produced (the thunk throws) ends the read with that error.

string | Promise<string>


url: string

Defined in: packages/client/src/circuits/stream-source.ts:35

Absolute URL of the stream, through the edge — never durable-streams directly.