@honua/sdk-js
    Preparing search index...

    Interface RealtimeWebSocketTransportOptions<TFeature>

    interface RealtimeWebSocketTransportOptions<TFeature = unknown> {
        cleanCloseCodes?: readonly number[];
        decodeEvent?: (payload: unknown) => RealtimeFeatureEvent<TFeature>;
        encodeRequest?: (url: URL, request: RealtimeSubscriptionRequest) => void;
        encodeSubscribeMessage?: (request: RealtimeSubscriptionRequest) => unknown;
        protocols?: string | readonly string[];
        url: string;
        webSocketFactory?: RealtimeWebSocketFactory;
    }

    Type Parameters

    • TFeature = unknown
    Index

    Properties

    cleanCloseCodes?: readonly number[]

    WebSocket close codes treated as a normal, non-reconnectable end of the stream rather than a transport-gap failure.

    [1000]
    
    decodeEvent?: (payload: unknown) => RealtimeFeatureEvent<TFeature>
    encodeRequest?: (url: URL, request: RealtimeSubscriptionRequest) => void
    encodeSubscribeMessage?: (request: RealtimeSubscriptionRequest) => unknown

    Sent as a single JSON text frame immediately after the socket opens, for servers that expect an explicit subscribe message instead of (or in addition to) URL query parameters. The default transport never sends a subscribe frame on its own.

    protocols?: string | readonly string[]
    url: string
    webSocketFactory?: RealtimeWebSocketFactory