🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@agentkitai/agentgate-discord

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agentkitai/agentgate-discord

Discord bot integration for AgentGate - receive approval requests and make decisions directly from Discord.

latest
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

@agentkitai/agentgate-discord

Discord bot integration for AgentGate - receive approval requests and make decisions directly from Discord.

Features

  • 📬 Rich embeds for approval requests with all details
  • 🔗 One-click approve/deny links (no authentication required)
  • 🔘 Interactive buttons for approve/deny (requires bot interaction)
  • ⚡ Real-time updates when decisions are made
  • 🎨 Color-coded urgency levels

Installation

pnpm add @agentkitai/agentgate-discord
# or
npm install @agentkitai/agentgate-discord

Configuration

Set the following environment variables:

VariableRequiredDescription
DISCORD_BOT_TOKENDiscord bot token (from Discord Developer Portal)
AGENTGATE_URLAgentGate server URL (default: http://localhost:3000)
DISCORD_CHANNEL_IDDefault channel ID for notifications
DISCORD_INCLUDE_LINKSInclude one-click links (default: true)

Usage

Standalone Mode

Run the bot as a standalone service:

# With environment variables
DISCORD_BOT_TOKEN=your-token AGENTGATE_URL=http://localhost:3000 pnpm start

# Or with .env file
pnpm start

Programmatic Usage

import { createDiscordBot } from '@agentkitai/agentgate-discord';

const bot = createDiscordBot({
  token: process.env.DISCORD_BOT_TOKEN!,
  agentgateUrl: 'http://localhost:3000',
  defaultChannelId: '123456789012345678',
  includeDecisionLinks: true,
});

await bot.start();

// Send an approval request to a specific channel
const messageId = await bot.sendApprovalRequest(
  {
    id: 'req-123',
    action: 'delete_file',
    params: { path: '/important/file.txt' },
    context: { user: 'agent-1' },
    urgency: 'high',
    status: 'pending',
    createdAt: new Date(),
    updatedAt: new Date(),
  },
  '987654321098765432'
);

// Graceful shutdown
process.on('SIGINT', () => bot.stop());

Discord Bot Setup

  • Go to the Discord Developer Portal
  • Create a new application
  • Go to "Bot" section and create a bot
  • Copy the bot token
  • Enable the required intents (Message Content is optional)
  • Go to "OAuth2" → "URL Generator"
  • Select scopes: bot, applications.commands
  • Select permissions: Send Messages, Embed Links, Use External Emojis
  • Use the generated URL to invite the bot to your server

Message Format

The bot sends rich embeds with:

  • Action: The requested action name
  • Urgency: Color-coded urgency level (🔴 Critical, 🟠 High, 🟡 Normal, 🟢 Low)
  • Request ID: Unique identifier
  • Parameters: JSON-formatted parameters (if any)
  • Context: Additional context (if any)
  • One-Click Links: Direct approve/deny URLs (if enabled)

Interactive buttons allow users to approve or deny directly from Discord.

Integration with AgentGate Server

The bot integrates with AgentGate's notification system. Configure the server to send notifications to Discord:

# Server environment variables
DISCORD_BOT_TOKEN=your-token
DISCORD_DEFAULT_CHANNEL=123456789012345678
CHANNEL_ROUTES='[{"channel":"discord","target":"123456789012345678","enabled":true}]'

API

createDiscordBot(options)

Creates a new Discord bot instance.

Options:

  • token (string, required): Discord bot token
  • agentgateUrl (string, required): AgentGate server URL
  • defaultChannelId (string, optional): Default channel for notifications
  • includeDecisionLinks (boolean, optional): Include one-click links (default: true)

Returns: DiscordBot instance

DiscordBot

  • client: The underlying Discord.js Client
  • start(): Start the bot
  • stop(): Stop the bot
  • sendApprovalRequest(request, channelId, options?): Send an approval request

Helper Functions

import {
  buildApprovalEmbed,
  buildDecidedEmbed,
  buildActionRow,
  getUrgencyEmoji,
  getUrgencyColor,
  EMBED_COLORS,
} from '@agentkitai/agentgate-discord';

License

MIT

FAQs

Package last updated on 26 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts