A sample application that routes Moov transfer events to a Slack channel. You can configure and deploy Moov for Slack to see it in action, and then fork the repository to customize it for your organization's needs.
Moov for Slack is a Node/Express application that uses the Moov API and the Slack Bolt SDK.
These prerequisites have to be in place before you can configure and launch Moov for Slack
☑️ A configuration file
- Clone this repository to your local device.
- Create a folder at the root named
./config
. - Copy
./config.example.yml
to the new folder and rename it to./config/config.yml
.
☑️ A publicly addressable host or IP address
You'll need to host Moov for Slack at a publicly addressable host so both Moov and Slack can reach it. If you're developing locally, you can use a service like ngrok to tunnel messages from a publicly addressable host to your local device.
☑️ Slack app
You'll need a Slack app to run inside your workspace and listen for notifications from Moov for Slack.
- Navigate to https://api.slack.com/apps.
- If you don't already have one, create and configure a new Slack app.
- Copy these configuration values to the
slack
section in./config/config.yml
:- The app's bot token
- The app's signing secret
- The name of the Slack channel where messages should appear, e.g.,
#moov-notifications
or@Amanda
- Turn on interactivity for the Slack app and set the request URL to:
https://<your publicly addressable host>/slack/events
☑️ Moov Account ID
- Navigate to https://dashboard.moov.io > Settings > Business details.
- Copy account ID to the
moov
section in./config/config.yml
:
☑️ Moov API key
- Navigate to https://dashboard.moov.io > Developers > API Keys.
- Create an API key for Moov for Slack.
- Copy these configuration values to the
moov
section in./config/config.yml
:- The key's domain, which you can set to
https://moovforslack.<yourcompany>.com
- The key's public key
- The key's secret key
- The key's domain, which you can set to
☑️ Moov Webhook
- Navigate to https://dashboard.moov.io > Developers > Webhooks.
- Create a new webhook.
- Set the URL to
https://<your publicaly addressable host>/webhooks
. - Select the
transfer.created
andtransfer.updated
events. If you fork and customize this app, be sure to subscribe to any additional events you'd like to receive. - Copy the webhook signing secret to the
moov
section in./config/config.yml
.
Use the scripts in package.json
to build and run:
yarn install
yarn build
yarn start
These commands are also available when needed:
yarn clean
yarn build:watch
yarn start:watch
By default the application will load and parse a configuration file from the filesystem at /config/config.yml
. This location can be overriden by setting the CONFIG_FILE_PATH
environment variable. Since this file contains configuration secrets we recommend using a secrets management facility such as Docker Secrets, Kubernetes Secrets, or Vault to mount and/or render this file.
An example configuration is available in the root of this repository at config.example.yml
along with the associated environment variable for each option.
Use ./Dockerfile
as a starting point to run Moov for Slack in a container environment.
Yes please! Be sure to submit an issue before submitting a pull request.
Moov would like to thank Arsenio Aguirre for getting this project off to a great start.