Discord Integration

Set up HookWatch to receive Discord webhooks for community events like messages, member joins, interactions, and guild updates.

Prerequisites

Step 1: Create a HookWatch endpoint

  1. Go to your Endpoints page
  2. Click "Create Endpoint"
  3. Enter a name like "Discord Webhooks"
  4. Enter your destination URL (where you want webhooks forwarded)
  5. Copy the generated webhook URL

Your HookWatch URL will look like:

https://hook.hookwatch.dev/wh/abc123xyz

Step 2: Configure Discord interactions endpoint

  1. Go to the Discord Developer Portal
  2. Select your application
  3. Navigate to "General Information"
  4. Paste your HookWatch URL in the "Interactions Endpoint URL" field
  5. Click "Save Changes"
  6. Copy the "Public Key" — you'll need it for signature verification

Common webhook event types:

MESSAGE_CREATE
MEMBER_JOIN
MEMBER_REMOVE
GUILD_UPDATE
INTERACTION_CREATE
MESSAGE_REACTION_ADD
CHANNEL_CREATE
CHANNEL_UPDATE

Step 3: Verify webhooks on your server

Discord uses Ed25519 signatures to verify webhook payloads. HookWatch forwards the X-Signature-Ed25519 and X-Signature-Timestamp headers so you can verify authenticity.

Node.js / Express (tweetnacl)

Tip

Install the tweetnacl package: npm install tweetnacl

Discord webhook headers

HookWatch forwards all Discord headers. Here are the important ones:

HeaderDescription
X-Signature-Ed25519Ed25519 signature for verification
X-Signature-TimestampTimestamp used in signature computation

Testing the integration

  1. Use a slash command or send a message in a channel with your bot
  2. Trigger an interaction (button click, select menu, etc.)
  3. Check your HookWatch Events page to see the events

Common issues

Endpoint verification fails

Discord sends a PING (type 1) when you set the Interactions Endpoint URL. Your server must respond with a type 1 acknowledgement. Make sure your forwarding destination handles this before setting the URL.

Signature verification fails

Ensure you're using the correct Public Key from your application's General Information page. The key must be hex-decoded before use with Ed25519 verification.

Interactions timing out

Discord requires an initial response within 3 seconds for interactions. If your server needs more time, respond with a deferred message (type 5) and follow up later.