Documentation / @super-line/client / SuperLineClientOptions
Interface: SuperLineClientOptions<C, R>
Defined in: index.ts:131
Options for createSuperLineClient.
Type Parameters
C
C extends Contract
R
R extends RoleOf<C>
Properties
onStoreError?
optionalonStoreError?: (error,info) =>void
Defined in: index.ts:152
Called when a store write is rejected by the server (e.g. FORBIDDEN). Default: logs to console.
Parameters
error
unknown
info
id
string
store
string
Returns
void
onValidationError?
optionalonValidationError?: (error,info) =>void
Defined in: index.ts:145
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:137
Extra handshake params passed to the transport (read in authenticate); role is added automatically.
reconnect?
optionalreconnect?:boolean
Defined in: index.ts:154
Auto-reconnect on drop. Defaults to true.
reconnectBaseMs?
optionalreconnectBaseMs?:number
Defined in: index.ts:156
Initial reconnect backoff in ms. Defaults to 500.
reconnectFactor?
optionalreconnectFactor?:number
Defined in: index.ts:160
Backoff growth factor. Defaults to 2.
reconnectMaxMs?
optionalreconnectMaxMs?:number
Defined in: index.ts:158
Maximum reconnect backoff in ms. Defaults to 30000.
role
role:
R
Defined in: index.ts:135
This client's role; narrows the surface and is sent to the server to verify.
serializer?
optionalserializer?:Serializer
Defined in: index.ts:139
Wire serializer; MUST match the server. Defaults to jsonSerializer.
stores?
optionalstores?:Record<string,ClientStore>
Defined in: index.ts:150
Client halves of the Store pairs, keyed by name to match the server's stores ({ scene: crdtStoreClient(), config: memoryStoreClient() }). Surfaced as client.store(name).
timeoutMs?
optionaltimeoutMs?:number
Defined in: index.ts:141
Default request timeout in ms. Defaults to 30000.
transport
transport:
ClientTransport
Defined in: index.ts:133
The transport to dial on, e.g. webSocketClientTransport({ url: 'ws://localhost:3000' }).
validate?
optionalvalidate?:"off"|"inbound"
Defined in: index.ts:143
'inbound' re-validates server→client payloads against the contract (catches drift). Default 'off'.