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.
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:
- Follow the "MAKING A WEBHOOK" instructions in the Discord docs.
- Copy the Webhook URL
- Create a
.env
file in thefunctions
directory - Add the
DISCORD_WEBHOOK_URL
variable and set it to your Webhook URL:DISCORD_WEBHOOK_URL="<your webhook url>"
Deploy functions using the Firebase CLI:
$ firebase deploy
© Google, 2022. Licensed under an Apache-2 license.