interface FirehoseOptions

Options for the Firehose class.

Properties

relay?: string

The Relay to connect to.

cursor?: string

The cursor to listen from. If not provided, the firehose will start from the latest event.

autoReconnect?: boolean

Whether to automatically reconnect when no new messages are received for a period of time. This will not reconnect if the connection was closed intentionally. To do that, listen for the "close" event and call start() again.

Default: true

ws?: typeof WebSocket | { CLOSED: number; CLOSING: number; CONNECTING: number; ... }

The WebSocket implementation to use (e.g. import ws from "ws"). Not required if you are on Node 21.0.0 or newer, or another environment that provides a WebSocket implementation.