Git Product home page Git Product logo

planetscale-to-slack's Introduction

PlanetScale-to-Slack

A app to connect PlanetScale database events to Slack notifications.

PlanetScale to Slack

Vercel Setup

  • Create a project on Vercel and deploy this repository
  • Set up a Slack App with chat:write and chat: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 requests
    • SLACK_BOT_TOKEN: The URL of your Slack app
    • SLACK_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

Standalone Setup

  • 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 requests
    • SLACK_BOT_TOKEN: The token for the slack bot of your application
    • SLACK_CHANNEL: The name of the Slack channel to send messages to
    • MODE: Set to standalone
    • 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 and chat: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
  • 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:

PlanetScale Logo

Contributing

Contributions are welcome. Feel free to submit a Pull Request.

License

MIT

planetscale-to-slack's People

Contributors

samlambert avatar bddicken avatar arifali123 avatar

Stargazers

 avatar Marc avatar Mike Coutermarsh avatar

Watchers

 avatar

Forkers

bddicken

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.