vapor-chamber API reference - v1.3.0
    Preparing search index...

    Type Alias WsBridgeOptions

    type WsBridgeOptions = {
        url: string;
        actions?: string[];
        reconnect?: boolean;
        reconnectDelay?: number;
        maxReconnects?: number;
        onConnect?: () => void;
        onDisconnect?: (event: CloseEvent) => void;
        onError?: (event: Event) => void;
        timeout?: number;
        maxQueueSize?: number;
    }
    Index

    Properties

    url: string

    WebSocket server URL

    actions?: string[]

    Which actions to forward. Glob patterns supported: '', 'cart'. Default: all actions.

    reconnect?: boolean

    Automatically reconnect on disconnect. Default: true

    reconnectDelay?: number

    Base reconnect delay in ms. Default: 1000

    maxReconnects?: number

    Max reconnect attempts. Default: 10

    onConnect?: () => void

    Called when the connection is established

    onDisconnect?: (event: CloseEvent) => void

    Called when the connection is lost

    onError?: (event: Event) => void

    Called on WebSocket error

    timeout?: number

    Per-message response timeout in ms. Default: 10_000

    maxQueueSize?: number

    Maximum number of messages to queue while disconnected. When exceeded, the oldest queued message is dropped with an error. Default: 100