This module provides two APIs that can be used to interact with Slack:
Use the webhook client for posting one-off messages to channels.
Use the Slack Web API when enabling user interactivity or calling any of the API
methods (https://api.slack.com/methods).
- Install the
SlackModule
- Create a secret for your app that contains the webhook path
- Provide a config in your app like so:
slack:
webhook_path: "filesystem:/etc/secrets/service/slack-webhook-url"
default_channel: "#misk" # optional
@Inject
theSlackClient
- Call
SlackClient.postMessage()
- Install the
RealSlackClientModule
- Upload the bearer token and signing secret provided by the Slack app. These are used by Slack to authenticate the request.
slack:
bearer_token: "filesystem:/etc/secrets/service/slack_bearer_token.txt"
signing_secret: "filesystem:/etc/secrets/service/slack_signing_secret.txt"
@Inject
theRealSlackClient