Skip to content

Send alerts to Slack from your code

Send rich notifications, alerts, and updates to Slack channels programmatically. Block Kit formatting, threads, and scheduled messages in one API.

Rich FormattingThread RepliesScheduled MessagesTemplates
import { Stack0 } from '@stack0/sdk'
const stack0 = new Stack0({ apiKey: process.env.STACK0_API_KEY })
// Send a simple alert to a Slack channel
export async function sendAlert(message: string) {
await stack0.integrations.communication.send({
provider: 'slack',
channel: '#alerts',
content: message,
})
}
// Send a rich notification with Block Kit formatting
export async function sendDeployNotification(deploy: Deploy) {
await stack0.integrations.communication.send({
provider: 'slack',
channel: '#deployments',
blocks: [
{
type: 'header',
text: `Deployment: ${deploy.service}`,
},
{
type: 'section',
fields: [
{ label: 'Environment', value: deploy.env },
{ label: 'Version', value: deploy.version },
{ label: 'Status', value: deploy.status },
{ label: 'Duration', value: `${deploy.durationMs}ms` },
],
},
{
type: 'actions',
buttons: [
{ text: 'View Logs', url: deploy.logsUrl },
{ text: 'Rollback', url: deploy.rollbackUrl },
],
},
],
})
}
// Reply in a thread
export async function sendThreadReply(threadId: string, message: string) {
await stack0.integrations.communication.send({
provider: 'slack',
channel: '#incidents',
threadId,
content: message,
})
}

What's included

Channel Routing

Send to any public or private channel. Route alerts by severity, team, or topic.

Rich Formatting

Headers, fields, buttons, and dividers. Build informative messages with Block Kit.

Scheduled Messages

Queue messages for future delivery. Daily digests, reminders, and delayed alerts.

Thread Replies

Reply in threads to group related updates. Keep channels organized and searchable.

User Mentions

Tag users and groups in messages. Ensure the right people see critical alerts.

Message Templates

Reusable templates with variables. Consistent formatting across all notifications.

Built for production

No Slack app needed

Connect your workspace in one click. No bot tokens, OAuth flows, or app manifests to manage.

Rich formatting

Send messages with headers, fields, buttons, and more. Our simplified block format handles the complexity.

Thread support

Reply in threads to keep channels clean. Group related updates under a single parent message.

Scheduled messages

Queue messages for future delivery. Send daily digests, scheduled reminders, or delayed alerts.

TypeScript SDK

Full type safety for blocks, channels, and message options. Autocomplete for every field.

Simple pricing

$1 per 1,000 API calls. No per-workspace fees or message limits.

Common implementations

Deploy Notifications

Alert your team on deployments with version, environment, and status details.

Incident Alerts

Route error alerts to on-call channels with severity levels and runbook links.

Sales Notifications

Notify the sales channel when new leads sign up or deals close.

Scheduled Digests

Send daily or weekly summary reports to team channels automatically.

Frequently asked questions

Ready to build?

Get started in minutes.

Get Started