Skip to main content

Chat

Access the Chat API Consumer. You can instantiate a Chat.Client to subscribe to Chat events. Please check Chat Events for the full list of events that a Chat.Client can subscribe to.

Example

The following example logs the messages sent to the "welcome" channel.

import { Chat } from "@signalwire/realtime-api";

const chatClient = new Chat.Client({
project: "<project-id>",
token: "<api-token>",
});

chatClient.on("message", (m) => console.log(m));

await chatClient.subscribe("welcome");

Classes