Constructor
constructor(options?)
Creates a new Firehose instance.
Parameters
options: FirehoseOptions = {}
Optional configuration.
Properties
Methods
on(event, listener)
Emitted when the connection is opened.
Parameters
event: "open"
listener: () => void
Returns
Unsubscribe
on(event, listener)
Emitted when the connection is closed.
Parameters
event: "close"
listener: (cursor: string) => void
Returns
Unsubscribe
on(event, listener)
Emitted when the websocket reconnects due to not receiving any messages for a period of time.
This will only be emitted if the
option is autoReconnect
.true
Parameters
event: "reconnect"
listener: () => void
Returns
Unsubscribe
on(event, listener)
Emitted when an error occurs while handling a message.
Parameters
event: "error"
listener: ({ cursor: string; error: Error; }) => () => void
Returns
Unsubscribe
on(event, listener)
Emitted when an error occurs within the websocket.
Parameters
event: "websocketError"
listener: ({ cursor: string; error: unknown; }) => () => void
Returns
Unsubscribe
on(event, listener)
Updates the repo to a new state, without necessarily including that state on the firehose. Used to recover from broken commit streams, data loss incidents, or in situations where upstream host does not know recent state of the repository.
Returns
Unsubscribe
on(event, listener)
Represents a change to an account's status on a host (eg, PDS or Relay).
Returns
Unsubscribe
on(event, listener)
Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint.