Skip to main content

SDK: Communication

The Communication client provides methods for managing channels, registrations, and sending messages across multiple delivery providers (Resend, Slack, Telegram, WhatsApp, webhooks).

Access it via client.communication.

Channels

// List channels
const channels = await client.communication.channels.list();

// Create a channel
const channel = await client.communication.channels.create({
name: "team-slack",
type: "slack",
config: { webhookUrl: "https://hooks.slack.com/..." },
});

// Get a channel
const ch = await client.communication.channels.get(channel.id);

Registrations

App registrations bind a Stage app to specific communication channels:

// Register an app for a channel
const reg = await client.communication.registrations.create({
appSid: "app_abc123",
channelId: channel.id,
});

// List registrations for an app
const regs = await client.communication.registrations.list({
appSid: "app_abc123",
});

Sending Messages

await client.communication.send({
channelId: channel.id,
to: "user@example.com",
subject: "Deployment complete",
text: "Your app has been deployed successfully.",
html: "<p>Your app has been deployed <b>successfully</b>.</p>",
metadata: { appSid: "app_abc123", event: "deploy" },
});

Delivery Tracking

const deliveries = await client.communication.deliveries.list({
channelId: channel.id,
since: "2026-03-01",
});

Notes

  • Channel configuration values can reference environment variables using ${} interpolation for secrets.
  • The Communication service is also accessible as a workflow block in Stage workflows via communication.send.