Skip to main content
zerotal

Documentation


Documentation / @zerotal/notifications / SlackChannel

Class: SlackChannel

Defined in: notifications/src/SlackChannel.ts:41

Slack notification channel — POSTs a JSON payload to an incoming webhook URL.

No npm dependencies — uses the global fetch API.

Usage in a Notification: channels() { return ['slack']; } toSlack(_notifiable: Notifiable): SlackMessage { return { webhookUrl: 'https://hooks.slack.com/...', text: 'Hello!' }; }

Constructors

Constructor

new SlackChannel(config?): SlackChannel

Defined in: notifications/src/SlackChannel.ts:42

Parameters

config?
webhook?

string

Returns

SlackChannel

Methods

send()

send(notifiable, notification): Promise<void>

Defined in: notifications/src/SlackChannel.ts:44

Parameters

notifiable

Notifiable

notification

Notification

Returns

Promise<void>