Welcome to the Multicast pubsub console. Generate and manage API keys or browse examples and documentation. Note, this service is still in demo/beta version. Do not use for mission critical systems.
Use the API Key Manager to generate a new key or manage an existing one. Do not share your key with anyone. Store it in a secure place. If you suspect your key has been compromised, rotate it immediately here. Usage counts are reset daily. Each free-tier token gets one dedicated channel named "MyChan".
To get started, install and import the published SDK for your preferred language then initialize a new client with your secure key. Subscribing or Publishing to topics is simple, just use the client as shown in the example. The client handles graceful reconnects on the underlying connection when needed.
// Initialize the Multicast PubSub client
const client = new McastClient({
apiKey: "YOUR_API_KEY",
channel: "MyChan",
});
// Subscribe to a channel
client.subscribe((topic, message) => {
console.log(`Received ${message} on ${topic}`);
}, "news");
// Publish a message
client.publish("news", {
title: "Breaking News",
content: "This is a test message"
});