slack-events-api v0.1.0

The middlewares you need to deal with Slack Events API

Slack Events API adapter for Crystal

Build Status

Github release

The middlewares you need to deal with Slack Events API


slack-events-api is a Crystal package composed of two middlewares:


  • Middleware that verifies that requests are correctly signed with SLACK_SIGNING_SECRET by Slack. All requests going through this middleware, will be checked. In the event of a request whose signature couldn't be verified, the middleware will early return with a 403 - Forbidden.
  • Receives SLACK_SIGNING_SECRET as its sole argument.


  • Middleware that does the initial challenge handshake between Slack and your API.

Further documentation can be found in


  1. Add this to your application's shard.yml:
    github: qu4tro/slack-events-api
  1. Run shards install


This example will suffice to perform the initial setup, but actual events will be 404'd, until you write your application-specific handler.

#!/usr/bin/env crystal

require "http/server"
require "http/server/handler"

require "slack-events-api"

middlewares = [,,["SLACK_SIGNING_SECRET"]),,
] do |server|
  address = server.bind_tcp "localhost", ENV["PORT"].to_i
  puts "Listening on http://#{address}"

Further work

  • Make JSON mappings for all event types supported by the Event API
  • If a reverse-proxy middleware comes up for Crystal, I think it's worth thinking about creating a docker image, to allow for the verification and challenge-setup to be automated for any ad-hoc server.


Any restriction to development should be tool-automated. So, feel free to open PRs. If all the tests pass, it should be good to merge, if it fits the package domain - opening an issue is a good way to clarify. In fact, feel free to open issues for any type of clarification.


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request


  • Xavier Francisco - Initial work - Qu4tro


This project is licensed under the MIT License - see the file for details

github statistic
  • 1
  • 0
  • 0
  • 0
  • about 2 years ago
  • September 14, 2019

MIT License

Synced at

Fri, 22 Oct 2021 05:13:25 GMT