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

    Constructors

    Accessors

    • get sessionId(): number | null

      Returns number | null

    Methods

    • Open the relay connection and resolve with the server's SessionInfo once the join is confirmed.

      Transport selection (options.transport, default 'auto'): WebTransport is tried first when available; any non-auth connect failure falls through to WebSocket, which then gets the retry ladder. WebTransport deliberately gets a single attempt in auto mode — its connect failures are almost always environmental (UDP/QUIC blocked), where retries only delay the transport that will actually work. Auth failures (401/403) surface immediately and never fall back.

      Returns Promise<SessionInfo>

    • Close the connection, drop subscribers, and release resources. Idempotent.

      Returns void

    • Fire-and-forget publish. The 4-byte sender session ID is stamped by the server, so the wire payload is just the encoded envelope.

      Type Parameters

      • T

      Parameters

      • topic: string
      • payload: T

      Returns void

    • Subscribe to a topic. Returns an unsubscribe function. Multiple subscribers per topic are supported and dispatched in registration order.

      Type Parameters

      • T

      Parameters

      Returns () => void