TrpcSseAdapterOptionsType
Options of the tRPC Server-Sent Events streams, 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
import { TrpcSseAdapterOptionsType } from "@hyper-fetch/trpc"
Source
Package
Preview
type TrpcSseAdapterOptionsType = {
EventSource?: typeof EventSource;
autoConnect?: boolean;
connectionParams?: TrpcConnectionParamsType;
eventSourceInit?: EventSourceInit;
}
Structure
TrpcSseAdapterOptionsType
| Name | Type | Description |
|---|---|---|
| EventSource | | The
|
| autoConnect | | Open the streams when the socket is created. Only the first connection depends on it - a socket connected by hand also opens them again when the app goes back online. |
| connectionParams | | Sent with every stream as the
|
| eventSourceInit | | Passed to the
|

