Guides / Monitoring

Get Discord Alerts from Smart Actions

3 min read·Monitoring

How Discord Webhooks Work

Discord supports incoming webhooks natively — no bot, no OAuth, no library needed. You post JSON to a URL and a message appears in your channel.

Smart Actions sends a POST request to any webhook URL when a rule fires, so Discord works out of the box.

Step 1: Create a Discord Webhook

  1. Open your Discord server → right-click the channel → Edit Channel
  2. Go to Integrations → Webhooks → New Webhook
  3. Name it (e.g. "LogIt Alerts"), copy the URL

The URL looks like:

https://discord.com/api/webhooks/1234567890/abcdefghijklmnop

Step 2: Log Events into LogIt

ts
await logit.now("errors", {
  event: "Application error",
  description: err.message,
  icon: "🚨",
  notify: false,
  tags: { severity: "high" },
  metadata: { stack: err.stack },
});

Step 3: Create the Smart Action

FieldValue
NameHigh-severity error → Discord
Channelerrors
Event nameApplication error
Threshold5
Window5 minutes
Cooldown15 minutes
ActionWebhook
URLYour Discord webhook URL

LogIt will POST to Discord and the message will appear in your channel within seconds of the threshold being crossed.

What the Discord Message Looks Like

json
{
  "content": "🔔 **Smart Action triggered**: High-severity error → Discord\n5+ Application error events in the last 5 minutes"
}

Tips

  • Create one Discord webhook per alert channel (errors, payments, signups) to route alerts into the right Discord room.
  • Set a 15-minute cooldown so a cascade failure doesn't flood your Discord server.
  • Discord has a rate limit of ~30 messages/minute per webhook — the cooldown handles this naturally.

Try LogIt free

7-day trial. No credit card required.

Start free