TrpcWebsocketAdapterOptionsType
Options of the tRPC WebSocket connection, passed as
adapterOptions
to the
Socket
.
They can be changed per connection attempt with
socket.onConnect
, e.g. to send a fresh auth token.
import { TrpcWebsocketAdapterOptionsType } from "@hyper-fetch/trpc"
Preview
type TrpcWebsocketAdapterOptionsType = {
WebSocket?: typeof WebSocket;
autoConnect?: boolean;
connectionParams?: TrpcConnectionParamsType;
keepAlive?: TrpcKeepAliveOptionsType;
protocols?: string | string[];
}
Structure
| Name | Type | Description |
|---|---|---|
| WebSocket | | The
|
| autoConnect | | Connect when the socket is created. Only the first connection depends on it - a socket connected by hand also reconnects after a lost connection and when the app goes back online. |
| connectionParams | | Sent as the first message of every connection, before any subscription starts.
The server reads them in
|
| keepAlive | | Sends
|
| protocols | | Subprotocols passed to the
|

