Enbbox Docs

Discord

Integrate Discord with Enbbox for chat notifications. Send notifications to Discord channels and users via bot tokens and webhook URLs.

Overview

Discord is a community platform. Enbbox sends notifications to Discord channels using Webhooks.

Step 1: Create a Discord Webhook

  1. Open Discord and navigate to the server/channel where you want notifications
  2. Click the gear icon next to the channel name → Integrations
  3. Click WebhooksNew Webhook
  4. Give the webhook a name (e.g., "Enbbox Notifications")
  5. Optionally set an avatar
  6. Click Copy Webhook URL

The URL looks like: https://discord.com/api/webhooks/1234567890/abcdefg...

Step 2: Connect to Enbbox

  1. Navigate to Integrations in the Enbbox dashboard
  2. Click Add Provider → select ChatDiscord
  3. No global credentials are needed — Discord uses per-subscriber webhook URLs
  4. Activate the integration

Step 3: Configure Subscriber Credentials

import { SubscriberCredentialsApi, Configuration } from "@enbbox/api";

const config = new Configuration({ accessToken: "your-api-key" });
const credentialsApi = new SubscriberCredentialsApi(config);

await credentialsApi.setCredentials("subscriber-123", "discord", {
  credentials: { webhook_url: "https://discord.com/api/webhooks/1234567890/abcdefg..." },
});

Step 4: Send a Test Notification

import { EventsApi, Configuration } from "@enbbox/api";

const config = new Configuration({ accessToken: "your-api-key" });
const eventsApi = new EventsApi(config);

await eventsApi.triggerEvent({
  name: "server-alert",
  to: { subscriberId: "subscriber-123" },
  payload: { message: "⚠️ Server CPU usage exceeded 90%" },
});

Advanced: Discord Bot

For richer features (embeds, reactions, DMs), create a Discord Bot:

  1. Go to discord.com/developers/applications
  2. Click New Application → name it → Create
  3. Navigate to BotAdd Bot
  4. Copy the Bot Token
  5. Under OAuth2URL Generator, select bot scope and Send Messages permission
  6. Use the generated URL to invite the bot to your server

Troubleshooting

IssueSolution
Webhook URL invalidRegenerate the webhook in channel settings
Message not deliveredEnsure the webhook hasn't been deleted
Embed not renderingCheck that your message format follows Discord's embed structure

On this page