Docs/Services

Discord

Send notifications to any Discord channel via an incoming webhook.

URL format

scheme
discord://webhook_id/webhook_token
SegmentRequiredDescription
webhook_idYesNumeric ID from the webhook URL (digits only)
webhook_tokenYesAlphanumeric token from the webhook URL

Example

typescript
import { notify } from '@ambersecurityinc/notifly';

await notify(
  { urls: ['discord://1234567890/abcdefghijklmnop'] },
  { title: 'Deploy Complete', body: 'v2.0 is live!', type: 'success' }
);

Finding your credentials

  1. Open your Discord server and go to Server Settings.
  2. Click Integrations → Webhooks.
  3. Select an existing webhook or click New Webhook.
  4. Choose the target channel and click Copy Webhook URL.
  5. The URL looks like:
    discord webhook url
    https://discord.com/api/webhooks/1234567890/abcdefghijklmnop
  6. Extract the two path segments after /webhooks/:
    • 1234567890 → webhook_id
    • abcdefghijklmnop → webhook_token

Smart paste

If you use the smartParse() function, you can paste the raw Discord webhook URL directly and it will be converted automatically:

typescript
import { smartParse } from '@ambersecurityinc/notifly/builder';

const result = smartParse(
  'https://discord.com/api/webhooks/1234567890/abcdefghijklmnop'
);
// → { service: 'discord', notiflyUrl: 'discord://1234567890/abcdefghijklmnop', ... }

Quirks & limitations

  • Discord webhooks are tied to a specific channel. To send to multiple channels, use multiple URLs.
  • The type field in NotiflyMessage maps to Discord embed colors:success → green, warning → yellow, failure → red.
  • Messages have a 2000-character body limit enforced by the Discord API.
← PreviousServices OverviewNext →Slack