Hiyve Components - v1.0.0
    Preparing search index...
    interface RelayOptions {
        maxSeenMessages?: number;
        onConnectionChange?: (state: RelayConnectionState) => void;
        onDebug?: (msg: string, ...args: unknown[]) => void;
        onError?: (err: Error) => void;
        pruneCount?: number;
        retryDelaysMs?: readonly number[];
        roomId: string;
        serverCertificateHashes?: RelayCertHash[];
        token: string;
        url: string;
        userId: string;
    }
    Index

    Properties

    maxSeenMessages?: number

    Maximum dedupe entries per topic before pruning kicks in. Default 200.

    onConnectionChange?: (state: RelayConnectionState) => void

    Notification when the connection state changes.

    onDebug?: (msg: string, ...args: unknown[]) => void

    Optional debug hook — pairs nicely with createDebugLogger('hiyve:semantic-relay').

    onError?: (err: Error) => void

    Connection-level error callback.

    pruneCount?: number

    Number of dedupe entries to drop when the cache is pruned. Default 50.

    retryDelaysMs?: readonly number[]

    Override the connect-retry policy. Defaults to three attempts with 200ms / 800ms / 2000ms backoff. Auth failures (401/403 from the handshake) are not retried regardless of this setting.

    roomId: string

    Room identifier — relay-side scope for broadcasts.

    serverCertificateHashes?: RelayCertHash[]

    Cert hashes for the browser WebTransport serverCertificateHashes option. The relay uses self-signed ECDSA P-256 certificates rotated every ~12 days; the app backend should fetch the current hash from the cert-hash file (private S3 in production) and pass it through.

    token: string

    HMAC-SHA256 JWT minted by the app backend.

    url: string

    WebTransport URL — must use the https:// scheme (HTTP/3). The relay adds query parameters for room and token, so callers should pass the raw base path, e.g. https://semantic.hiyve.tv:4443/relay.

    userId: string

    Identifier the consumer treats as authoritative. Duplicated into every published envelope so subscribers can attribute messages without waiting for a peer-presence stream from the server. Should match the JWT's userId claim — the SDK does not enforce this, but mismatches lead to confusing attribution.