Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abdolence/slack-morphism-rust
A modern async client library for Rust, supports Slack Web / Events API/Socket Mode and Block Kit.
https://github.com/abdolence/slack-morphism-rust
rust rust-crate slack slack-api
Last synced: about 23 hours ago
JSON representation
A modern async client library for Rust, supports Slack Web / Events API/Socket Mode and Block Kit.
- Host: GitHub
- URL: https://github.com/abdolence/slack-morphism-rust
- Owner: abdolence
- License: apache-2.0
- Created: 2020-05-27T10:26:43.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-22T12:19:02.000Z (9 months ago)
- Last Synced: 2024-04-24T03:54:05.542Z (9 months ago)
- Topics: rust, rust-crate, slack, slack-api
- Language: Rust
- Homepage: https://slack-rust.abdolence.dev
- Size: 2.52 MB
- Stars: 132
- Watchers: 4
- Forks: 50
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
[![Cargo](https://img.shields.io/crates/v/slack_morphism.svg)](https://crates.io/crates/slack_morphism)
![tests and formatting](https://github.com/abdolence/slack-morphism-rust/workflows/tests%20&%20formatting/badge.svg)
![security audit](https://github.com/abdolence/slack-morphism-rust/workflows/security%20audit/badge.svg)# 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 exampleTo run example use with environment variables:
```
# SLACK_... cargo run --example --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](https://ngrok.com/):
```
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= \
SLACK_CLIENT_SECRET= \
SLACK_BOT_SCOPE=app_mentions:read,incoming-webhook \
SLACK_REDIRECT_HOST=https://.ngrok.io \
SLACK_SIGNING_SECRET= \
cargo run --example events_api_server --all-features
```## Licence
Apache Software License (ASL)## Author
Abdulla Abdurakhmanov