Create new instance of Fishjam Client.
Does not verify credentials against the backend — use FishjamClient.create or call FishjamClient.checkCredentials afterwards for that.
Example usage:
const fishjamClient = new FishjamClient({
fishjamId: fastify.config.FISHJAM_ID,
managementToken: fastify.config.FISHJAM_MANAGEMENT_TOKEN,
});
Verifies the configured credentials by making a single lightweight call to the Fishjam backend. Resolves on success, throws InvalidFishjamCredentialsException on 401/404 from the backend, otherwise rethrows the standard mapped exception.
StaticcreateAsync factory: constructs a client and verifies credentials against the backend.
Throws InvalidFishjamCredentialsException when the
fishjamId / managementToken pair is rejected by the backend.
Example:
const client = await FishjamClient.create({
fishjamId: process.env.FISHJAM_ID!,
managementToken: process.env.FISHJAM_MANAGEMENT_TOKEN!,
});
Create a new agent assigned to a room.
Optionalcallbacks: AgentCallbacksCreates a livestream streamer token for the given room.
a livestream streamer token
Creates a livestream viewer token for the given room.
a livestream viewer token
Creates MoQ access.
Optionalconfig: MoqAccessConfigconnection details containing the relay URL with the JWT embedded as a ?jwt= query parameter, and the token itself
Create a new peer assigned to a room.
Create a new room. All peers connected to the same room will be able to send/receive streams to each other.
Create a new VAPI agent assigned to a room.
Delete an existing room. All peers connected to this room will be disconnected and removed.
Get a list of all existing rooms.
Refresh the peer token for an already existing peer. If an already created peer has not been connected to the room for more than 24 hours, the token will become invalid. This method can be used to generate a new peer token for the existing peer.
refreshed peer token
Subscribe a peer to specific tracks from another peer - this will make only the specified tracks from the publisher available to the subscriber. Using this function only makes sense if subscribeMode is set to manual
Client class that allows to manage Rooms and Peers for a Fishjam App. It requires the Fishjam ID and management token that can be retrieved from the Fishjam Dashboard.