Hiyve Components - v1.0.0
    Preparing search index...

    Interface UseRelaySubProtocolOptions<TPayload>

    interface UseRelaySubProtocolOptions<TPayload> {
        dedupWindow?: number;
        defaultRequireAck?: boolean;
        ignoreOwnMessages?: boolean;
        localUserId: string;
        onError?: (err: Error) => void;
        onMessage?: (payload: TPayload, meta: RelaySubProtocolMessageMeta) => void;
        topic: string;
    }

    Type Parameters

    • TPayload
    Index

    Properties

    dedupWindow?: number

    How many recent messageIds to remember for dedup.

    200
    
    defaultRequireAck?: boolean

    Default ack policy for publish(payload) calls without an explicit requireAck option.

    true
    
    ignoreOwnMessages?: boolean

    Skip messages where senderId === localUserId. Almost always true — the only reason to disable is a tee/test harness that needs to observe its own publishes.

    true
    
    localUserId: string

    Local user's id. Used to filter out the local user's own messages (the relay echoes them by default) and to scope per-sender reassembly buffers.

    onError?: (err: Error) => void

    Called when a message exhausts its retry budget without an ack — useful for surfacing to a "live features degraded" UI surface or a debug overlay. Not fired for requireAck: false publishes.

    onMessage?: (payload: TPayload, meta: RelaySubProtocolMessageMeta) => void

    Called for every remote message that survives dedup + self-filtering.

    topic: string

    Relay topic name. Use a dotted hierarchy to keep namespaces tidy (e.g. 'hiyve.collab.polls.vote-cast', 'hiyve.annotations.stroke-append').