#slack #slack-client #api-bindings #client

slack-morphism

Slack Morphism is a modern client library for Slack Web/Events API/Socket Mode and Block Kit

108 releases (46 stable)

2.10.1 Mar 19, 2025
2.8.0 Jan 1, 2025
2.7.0 Dec 9, 2024
2.6.0 Nov 12, 2024
0.3.1 Oct 20, 2020

#7 in WebSocket

Download history 8788/week @ 2024-12-04 9102/week @ 2024-12-11 5722/week @ 2024-12-18 3243/week @ 2024-12-25 6647/week @ 2025-01-01 26674/week @ 2025-01-08 21419/week @ 2025-01-15 10407/week @ 2025-01-22 9802/week @ 2025-01-29 13187/week @ 2025-02-05 9159/week @ 2025-02-12 10681/week @ 2025-02-19 13350/week @ 2025-02-26 11254/week @ 2025-03-05 12461/week @ 2025-03-12 10870/week @ 2025-03-19

49,963 downloads per month
Used in 11 crates (5 directly)

Apache-2.0

405KB
10K SLoC

Cargo tests and formatting security audit

Slack Morphism for Rust

Slack Morphism is a modern client library for Slack Web/Events API/Socket Mode and Block Kit.

Documentation

Please follow to the official website: https://slack-rust.abdolence.dev.

Examples

https://github.com/abdolence/slack-morphism-rust/tree/master/examples

The examples require to work the following environment variables (from your Slack bot profile in api.slack.com):

  • SLACK_TEST_TOKEN - for Slack client example
  • SLACK_TEST_APP_TOKEN - for Slack client with Socket Mode example
  • SLACK_CLIENT_ID, SLACK_CLIENT_SECRET, SLACK_BOT_SCOPE, SLACK_REDIRECT_HOST - for OAuth routes for Events API example
  • SLACK_SIGNING_SECRET for all routes for Events API example

To run example use with environment variables:

# SLACK_... cargo run --example <client|events_api_server|axum_events_api_server|socket_mode> --all-features

Routes for this example are available on http://:8080:

  • /auth/install - to begin OAuth installation
  • /auth/callback - a callback endpoint for Slack OAuth profile config
  • /push - for Slack Push Events
  • /interaction - for Slack Interaction Events
  • /command - for Slack Command Events

Testing Events API with ngrok

For development/testing purposes you can use ngrok:

ngrok http 8080

and copy the URL it gives for you to the example parameters for SLACK_REDIRECT_HOST.

Example testing with ngrok:

SLACK_CLIENT_ID=<your-client-id> \
SLACK_CLIENT_SECRET=<your-client-secret> \
SLACK_BOT_SCOPE=app_mentions:read,incoming-webhook \
SLACK_REDIRECT_HOST=https://<your-ngrok-url>.ngrok.io \
SLACK_SIGNING_SECRET=<your-signing-secret> \
cargo run --example events_api_server  --all-features

Licence

Apache Software License (ASL)

Author

Abdulla Abdurakhmanov

Dependencies

~9–23MB
~311K SLoC