Documentation / @super-line/client / SuperLineClientOptions
Interface: SuperLineClientOptions<C, R>
Defined in: index.ts:385
Options for createSuperLineClient.
Type Parameters
C
C extends Contract
R
R extends RoleOf<C>
Properties
crdtCollections?
optionalcrdtCollections?:CrdtCollectionClient
Defined in: index.ts:405
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.
onConnect?
optionalonConnect?: () =>void
Defined in: index.ts:411
Called on the first successful connect.
Returns
void
onDisconnect?
optionalonDisconnect?: (code) =>void
Defined in: index.ts:413
Called when the socket drops, with the close code.
Parameters
code
number
Returns
void
onError?
optionalonError?: (error,info) =>void
Defined in: index.ts:417
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:415
Called on each successful reconnect after the first.
Returns
void
onStoreError?
optionalonStoreError?: (error,info) =>void
Defined in: index.ts:407
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:399
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:391
Extra handshake params passed to the transport (read in authenticate); role is added automatically.
plugins?
optionalplugins?:SuperLineClientPlugin[]
Defined in: index.ts:409
Client plugin halves (lifecycle, server→client handlers). See SuperLineClientPlugin.
reconnect?
optionalreconnect?:boolean
Defined in: index.ts:419
Auto-reconnect on drop. Defaults to true.
reconnectBaseMs?
optionalreconnectBaseMs?:number
Defined in: index.ts:421
Initial reconnect backoff in ms. Defaults to 500.
reconnectFactor?
optionalreconnectFactor?:number
Defined in: index.ts:425
Backoff growth factor. Defaults to 2.
reconnectMaxMs?
optionalreconnectMaxMs?:number
Defined in: index.ts:423
Maximum reconnect backoff in ms. Defaults to 30000.
role
role:
R
Defined in: index.ts:389
This client's role; narrows the surface and is sent to the server to verify.
serializer?
optionalserializer?:Serializer
Defined in: index.ts:393
Wire serializer; MUST match the server. Defaults to jsonSerializer.
timeoutMs?
optionaltimeoutMs?:number
Defined in: index.ts:395
Default request timeout in ms. Defaults to 30000.
transport
transport:
ClientTransport
Defined in: index.ts:387
The transport to dial on, e.g. webSocketClientTransport({ url: 'ws://localhost:3000' }).
validate?
optionalvalidate?:"off"|"inbound"
Defined in: index.ts:397
'inbound' re-validates server→client payloads against the contract (catches drift). Default 'off'.