Skip to main content

prefect_slack.credentials

Credential classes use to store Slack credentials.

Classes

SlackCredentials

Block holding Slack credentials for use in tasks and flows. Args:
  • token: Bot user OAuth token for the Slack app used to perform actions.
Examples: Load stored Slack credentials:
Get a Slack client:
Methods:

get_client

Returns an authenticated AsyncWebClient to interact with the Slack API.

SlackWebhook

Block holding a Slack webhook for use in tasks and flows. Args:
  • url: Slack webhook URL which can be used to send messages (e.g. https\://hooks.slack.com/XXX).
Examples: Load stored Slack webhook:
Get a Slack webhook client:
Send a notification in Slack:
Methods:

get_client

Returns an authenticated AsyncWebhookClient to interact with the configured Slack webhook.

notify

Sends a message to the Slack channel.

notify_async

Sends a message to the Slack channel asynchronously.