This example sends a message to Discord when receiving a server failed webhook.
If you haven't already, sign up for a Render account. Creating webhooks on Render requires a Professional plan or higher. You can view and upgrade your plan in the Render Dashboard.
-
Follow instructions to create a webhook with the URL from your service and
/webhookpath -
Follow instructions to create a Render API Key
-
Follow instructions to create a Discord App and copy the token
-
Navigate to the installation settings for your app and
- add
botscope - add
SendMessagesandViewChannelspermissions
- add
-
Set the following env vars
RENDER_WEBHOOK_SECRETenvironment variable to the secret from the webhook created in step 2RENDER_API_KEYto the key created in step 3DISCORD_TOKENto the token created in step 4DISCORD_CHANNEL_IDto the channel id you want messages sent to
Once you've created a project and installed dependencies with pnpm install, start a development server:
pnpm run devpnpm run build