Docs / Services

Slack

Send notifications to Slack channels via incoming webhooks.

URL format

scheme
slack://token_a/token_b/token_c[/channel]
Segment Required Description
token_a Yes First path segment from the Slack webhook URL (e.g. T00000000)
token_b Yes Second path segment (e.g. B00000000)
token_c Yes Third path segment — treat as a secret
channel No Override the default channel (e.g. #alerts)

Example

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

await notify(
  { urls: ['slack://T00000000/B00000000/XXXXXXXXXXXXXXXX'] },
  { title: 'Alert', body: 'Disk usage above 90%', type: 'warning' }
);

Finding your credentials

  1. Go to api.slack.com/apps and open or create your Slack app.
  2. Click Incoming Webhooks and enable it.
  3. Click Add New Webhook to Workspace and pick a channel.
  4. Copy the webhook URL — it looks like:
    slack webhook url
    https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXX
  5. The three path segments after /services/ map directly to token_a, token_b, token_c.

Smart paste

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

const result = smartParse(
  'https://hooks.slack.com/services/T00000000/B00000000/XXXX'
);
// → { service: 'slack', notiflyUrl: 'slack://T00000000/B00000000/XXXX', ... }

Quirks & limitations

  • The webhook is bound to the channel chosen at creation time unless you override with a channel segment.
  • token_c is sensitive — store it in an environment variable, not source code.
← Previous Discord Next → Telegram