Slack
Post domain events to a Slack channel with the Slack plugin.
@headless-lms/plugin-slack posts domain events — entitlement grants, updates, expiries — to a Slack channel, formatted per event type.
Actions
| Action | What it does |
|---|---|
postToChannel | Posts a domain event to a channel. entitlement.* events get rich Block Kit formatting; unknown types post generically. The channel falls back to the connection's defaultChannel. |
listChannels | Lists public channels (for channel pickers), paginated. |
Formatted events: entitlement.created, entitlement.updated, entitlement.deleted, entitlement.expired. Course grants read "enrolled"; other content types read "granted access to".
Setup
- Create a Slack app at api.slack.com/apps.
- Under OAuth & Permissions, add the bot scopes
chat:write(post) andchannels:read(list). - Install the app to your workspace and copy the Bot User OAuth Token (
xoxb-…). - Connect the integration with the secret
botTokenand configdefaultChannel, and invite the bot to that channel.
Wiring
The reference installation loads it through the plugin folder convention: apps/api/src/plugins/slack/index.ts re-exports this package's default export. In your own installation, add a slack/ folder to your plugins directory that does the same.