Skip to main content
Version: v10.0.0

OrpcStreamAdapterOptionsType

Options of the OrpcStreamAdapter , set with the adapterOptions of the socket or per connection in onConnect


Import
import { OrpcStreamAdapterOptionsType } from "@hyper-fetch/orpc"

Preview​

type OrpcStreamAdapterOptionsType = {
autoConnect?: boolean;
fetch?: typeof fetch;
fetchOptions?: Omit<RequestInit, method | headers | body | signal>;
headers?: Record<string, string>;
}

Structure​

OrpcStreamAdapterOptionsType
NameTypeDescription
autoConnect
boolean

Connects when the socket is created. Without it, call socket.connect() .

fetch
typeof fetch

The fetch used for the streams, e.g. one with a proxy agent or a mock in tests. Defaults to the global fetch

of browsers, Node.js 18+, Bun and Deno.

fetchOptions
Omit<RequestInit, method | headers | body | signal>

Options passed to fetch , e.g. credentials: &quot;include&quot; for cookies on another origin

headers
Record<string, string>

Headers of every stream request, e.g. the authorization header