Documentation / @super-line/client / SuperLineClientOptions
Interface: SuperLineClientOptions<C, R>
Defined in: index.ts:389
Options for createSuperLineClient.
Type Parameters
C
C extends Contract
R
R extends RoleOf<C>
Properties
crdtCollections?
optionalcrdtCollections?:CrdtCollectionClient
Defined in: index.ts:409
The client-side CRDT engine for CRDT document collections (ADR-0007), e.g. crdtCollections: crdtCollectionsClient(). Universal across backend tiers — the client only merges opaque deltas. Required to open any CRDT collection.
keepalive?
optionalkeepalive?:number
Defined in: index.ts:435
Liveness from this side (ADR-0028), in ms; off by default. The client pings every keepalive ms, and when nothing at all has arrived from the server by the next ping it drops the socket and reconnects. Use it when the server's transport runs no heartbeat — a hibernating host answers these pings without waking.
onConnect?
optionalonConnect?: () =>void
Defined in: index.ts:415
Called on the first successful connect.
Returns
void
onDisconnect?
optionalonDisconnect?: (code) =>void
Defined in: index.ts:417
Called when the socket drops, with the close code.
Parameters
code
number
Returns
void
onError?
optionalonError?: (error,info) =>void
Defined in: index.ts:421
Receives a throw from any lifecycle hook (host or plugin). Default: logs to console.
Parameters
error
unknown
info
Returns
void
onReconnect?
optionalonReconnect?: () =>void
Defined in: index.ts:419
Called on each successful reconnect after the first.
Returns
void
onStoreError?
optionalonStoreError?: (error,info) =>void
Defined in: index.ts:411
Called when a CRDT document write is rejected by the server (e.g. FORBIDDEN, validation). Default: logs to console.
Parameters
error
unknown
info
id
string
store
string
Returns
void
onValidationError?
optionalonValidationError?: (error,info) =>void
Defined in: index.ts:403
Called when an inbound payload fails validation (only with validate: 'inbound').
Parameters
error
unknown
info
Returns
void
params?
optionalparams?:Record<string,string>
Defined in: index.ts:395
Extra handshake params passed to the transport (read in authenticate); role is added automatically.
plugins?
optionalplugins?:SuperLineClientPlugin[]
Defined in: index.ts:413
Client plugin halves (lifecycle, server→client handlers). See SuperLineClientPlugin.
reconnect?
optionalreconnect?:boolean
Defined in: index.ts:423
Auto-reconnect on drop. Defaults to true.
reconnectBaseMs?
optionalreconnectBaseMs?:number
Defined in: index.ts:425
Initial reconnect backoff in ms. Defaults to 500.
reconnectFactor?
optionalreconnectFactor?:number
Defined in: index.ts:429
Backoff growth factor. Defaults to 2.
reconnectMaxMs?
optionalreconnectMaxMs?:number
Defined in: index.ts:427
Maximum reconnect backoff in ms. Defaults to 30000.
role
role:
R
Defined in: index.ts:393
This client's role; narrows the surface and is sent to the server to verify.
serializer?
optionalserializer?:Serializer
Defined in: index.ts:397
Wire serializer; MUST match the server. Defaults to jsonSerializer.
timeoutMs?
optionaltimeoutMs?:number
Defined in: index.ts:399
Default request timeout in ms. Defaults to 30000.
transport
transport:
ClientTransport
Defined in: index.ts:391
The transport to dial on, e.g. webSocketClientTransport({ url: 'ws://localhost:3000' }).
validate?
optionalvalidate?:"off"|"inbound"
Defined in: index.ts:401
'inbound' re-validates server→client payloads against the contract (catches drift). Default 'off'.