Notifications
Slack, Discord, signed webhooks and email channels, and the events they receive.
A notification channel is an object with an id, a type, an optional
events filter and a send() method. Four builders ship with the package,
and anything matching the contract can be added to notifications.channels.
Defaults to 3. A monitor.down event fires on the check run where the
consecutive-failure count reaches this number — not before and not
again. The matching monitor.recovered fires once afterwards.
Defaults to []. Channel ids must be unique.
Event catalogue
| Event | Raised when |
|---|---|
monitor.down | A monitor's consecutive failures reach failureThreshold. |
monitor.recovered | A monitor succeeds after a threshold-reaching outage. |
ssl.expiring | An SSL monitor fails only because of an approaching expiry. |
incident.created | An incident is opened manually or automatically. |
incident.updated | A timeline entry is added, or the incident is edited. |
incident.resolved | An incident reaches resolved. |
maintenance.scheduled | A window is created or edited while scheduled. |
maintenance.starting | A window becomes in-progress. |
maintenance.completed | A window becomes completed. |
Every builder accepts an events array of selectors. Wildcards are expanded
once, at construction, so the dispatcher only compares exact names:
Valid selectors are any event name, monitor.*, ssl.*, incident.*,
maintenance.* and *. An empty array, a duplicate or an unknown selector
throws. Omitting events subscribes the channel to everything.
Slack
Slack incoming-webhook URL.
Defaults to "slack". Appears in the notification log.
Incoming-webhook channel override.
Fallback text used only when the event belongs to a critical incident.
Defaults to true. Adds the latency field to the Block Kit payload.
Injectable fetch, for tests or a proxy.
Messages are Block Kit: a coloured header, the check message, detail fields
(type, target, status, latency, consecutive failures) and a View Status
Page button when siteUrl is configured.
Discord
mentionRole accepts a role ID (rendered as <@&id>), an existing
<@&id> mention, or a plain name (rendered as @name). The payload is a
single embed, coloured green for recoveries, red for failures and amber for
everything else.
Signed webhooks
HTTP(S) destination.
Shared secret used for the HMAC-SHA256 signature. Cannot be empty.
Defaults to 3 total attempts, between 1 and 10.
Defaults to 250, doubled on each retry.
Extra request headers. content-type and the signature headers are always
set by the channel.
Each request carries:
Verify it on the receiving side with the helper the package exports:
The payload is the stable JSON produced by toStatusEventPayload():
incident and maintenance objects are added for their respective events.
| Transport | Requirements |
|---|---|
resend | apiKey. Optional endpoint override. |
aws-ses | accessKeyId, secretAccessKey, optional region (default us-east-1), sessionToken, endpoint. Requests are SigV4-signed in-process; no AWS SDK is bundled. |
cloudflare | A send callback bound to your Email binding. |
smtp | A send callback backed by your SMTP transport. |
An email channel is also what makes public email subscriptions possible:
the first configured email channel exposes sendEmail(), which the
subscription flow reuses for confirmation and incident mail. Without one,
POST /subscribers with type: "email" answers 503.
Custom channels
Any object matching NotificationChannel is accepted:
type must be one of slack, discord, webhook or email — it classifies
the row written to the notification log. Returning
{ attempts } records how many tries the delivery took.
Delivery guarantees
- Channel failures are isolated. A broken webhook never fails a check run, an incident update or an HTTP request.
- Every attempt is written to
notification_logwith its channel, event, status, attempt count and error, readable viaGET /admin/notifications/log. - Writing that log is itself best-effort: a logging failure is swallowed for the same reason.
- Only the generic
webhookchannel retries. Slack, Discord and email report the first failure.