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.

1

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.

2

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.

3

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:

https://alerts.example.com/api/webhook/your-unique-token

Click the copy button to copy the full URL to your clipboard. This URL is unique to this channel and should be kept secret.

4

Send your first alert

Open a terminal and run this cURL command. Replace the URL with your actual webhook URL:

Terminal
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:

json
{ "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.

5

Integrate with your app

Now that you've confirmed the webhook works, add it to your application. Here's a minimal example:

TypeScript
// 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:

Usage Examples
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",
});

Next Steps