Back to Functions Samples

Quickstart: Send Firebase Alerts to Discord

Node/alerts-to-discord/README.md

latest1.2 KB
Original Source

Quickstart: Send Firebase Alerts to Discord

This quickstart demonstrates how to trigger a function based on a Firebase Alert, and send information about the alert to a channel in a Discord server.

Set up and Deploy

Discord Webhook URL

The sample uses Discord Webhooks to send alerts to a Discord channel. You'll need to create a Webhook and hook it up the function by creating an environment variable:

  1. Follow the "MAKING A WEBHOOK" instructions in the Discord docs.
  2. Copy the Webhook URL
  3. Create a .env file in the functions directory
  4. Add the DISCORD_WEBHOOK_URL variable and set it to your Webhook URL:
    bash
    DISCORD_WEBHOOK_URL="<your webhook url>"
    

Deploy

Deploy functions using the Firebase CLI:

bash
$ firebase deploy

License

© Google, 2022. Licensed under an Apache-2 license.