Getting Started
Get up and running with Alerts in a few minutes. By the end of this guide, you'll have a channel set up and your first alert delivered.
Create an account
Head to the signup page and create your account using your email address. You'll receive a magic link to verify your email.
After verifying, you'll be prompted to create your first workspace. A workspace is your team's home for channels and alerts.
Create your first channel
Once inside your workspace, click the + button in the sidebar to create a new channel. Give it a descriptive name like deploys, errors, or signups.
You can optionally assign the channel to a category to keep things organized. Categories are like folders that group related channels.
Copy your webhook URL
Open your channel's settings by clicking the gear icon in the channel header. You'll see a Webhook URL that looks like this:
Click the copy button to copy the full URL to your clipboard. This URL is unique to this channel and should be kept secret.
Send your first alert
Open a terminal and run this cURL command. Replace the URL with your actual webhook URL:
curl -X POST https://alerts.example.com/api/webhook/your-token \
-H "Content-Type: application/json" \
-d '{
"title": "Hello from the terminal!",
"level": "success",
"emoji": "👋",
"message": "If you can see this, your webhook is working."
}'curl -X POST https://alerts.example.com/api/webhook/your-token \
-H "Content-Type: application/json" \
-d '{
"title": "Hello from the terminal!",
"level": "success",
"emoji": "👋",
"message": "If you can see this, your webhook is working."
}'You should receive a success response:
{ "success": true, "alertId": "clx..." }{ "success": true, "alertId": "clx..." }Switch to your browser and you'll see the alert appear in your channel. If you enabled email notifications, you'll also get an email.
Integrate with your app
Now that you've confirmed the webhook works, add it to your application. Here's a minimal example:
// lib/alerts.ts
const WEBHOOK_URL = process.env.ALERTS_WEBHOOK_URL;
export async function sendAlert(payload: {
title: string;
level?: "info" | "success" | "warning" | "error";
emoji?: string;
message?: string;
fields?: { label: string; value: string; inline?: boolean }[];
linkUrl?: string;
linkText?: string;
source?: string;
}) {
if (!WEBHOOK_URL) return;
// Fire and forget - don't block your app
fetch(WEBHOOK_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload),
}).catch(console.error);
}// lib/alerts.ts
const WEBHOOK_URL = process.env.ALERTS_WEBHOOK_URL;
export async function sendAlert(payload: {
title: string;
level?: "info" | "success" | "warning" | "error";
emoji?: string;
message?: string;
fields?: { label: string; value: string; inline?: boolean }[];
linkUrl?: string;
linkText?: string;
source?: string;
}) {
if (!WEBHOOK_URL) return;
// Fire and forget - don't block your app
fetch(WEBHOOK_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload),
}).catch(console.error);
}Then use it anywhere in your backend code:
import { sendAlert } from "@/lib/alerts";
// User signup
sendAlert({
title: "New user signup",
level: "success",
emoji: "🎉",
message: `${user.email} created an account`,
fields: [
{ label: "Plan", value: "Free Trial", inline: true },
{ label: "Source", value: "Google OAuth", inline: true },
],
source: "auth",
});
// Error handling
sendAlert({
title: "API Error",
level: "error",
emoji: "🔥",
message: error.message,
fields: [
{ label: "Endpoint", value: req.url, inline: true },
{ label: "Status", value: "500", inline: true },
],
source: "api",
});import { sendAlert } from "@/lib/alerts";
// User signup
sendAlert({
title: "New user signup",
level: "success",
emoji: "🎉",
message: `${user.email} created an account`,
fields: [
{ label: "Plan", value: "Free Trial", inline: true },
{ label: "Source", value: "Google OAuth", inline: true },
],
source: "auth",
});
// Error handling
sendAlert({
title: "API Error",
level: "error",
emoji: "🔥",
message: error.message,
fields: [
{ label: "Endpoint", value: req.url, inline: true },
{ label: "Status", value: "500", inline: true },
],
source: "api",
});