A app to connect PlanetScale database events to Slack notifications.
- Create a project on Vercel and deploy this repository
- Set up a Slack App with
chat:write
andchat:write.customize
scopes - Configure webhooks for your PlanetScale database
- Set the following environment variables in Vercel:
PLANETSCALE_WEBHOOK_SECRET
: The secret used to verify webhook requestsSLACK_BOT_TOKEN
: The URL of your Slack appSLACK_CHANNEL
: The name of the Slack channel to send messages to
- To test your app is working you can send a test webhook from PlanetScale and a message will be sent to Slack
- Profit
- Spin up any cloud VM such as an Amazon EC2 instance or DigitalOcean droplet.
- Log in and download node, npm, npx, typescript, and any other requirements
- Choose a domain you own and set up the DNS to point to your instance/droplet (for example,
ps-webhooks.com
) - Set up an HTTPS cert using LetsEncrypt
- Check out this repository
- From the repository root, create a
.env
file and set up the following variables:PLANETSCALE_WEBHOOK_SECRET
: The secret used to verify webhook requestsSLACK_BOT_TOKEN
: The token for the slack bot of your applicationSLACK_CHANNEL
: The name of the Slack channel to send messages toMODE
: Set tostandalone
CREDENTIALS_PATH
: The path where the LetsEncrypt variables were saved into (possibly/etc/letsencrypt/live/yourdomain/
)
- Start the server with
npx tsx api/index.ts
- Set up a Slack App with
chat:write
andchat:write.customize
scopes - Configure webhooks for your PlanetScale database
- Set the webhook url to the domain you chose + '/webhook'. For example:
https://ps-webhooks.com/webhook
- Set the webhook url to the domain you chose + '/webhook'. For example:
- To test your app is working you can send a test webhook from PlanetScale and a message will be sent to Slack
- Profit
This version of the PlanetScale is the right size for a Slack app logo:
Contributions are welcome. Feel free to submit a Pull Request.