npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

directus-extension-discord-operation

v1.1.0

Published

Send text or rich embed messages to Discord channels/threads

Readme

Directus Discord Operation

A powerful Directus operation extension that enables sending text messages and rich embeds to Discord channels or threads directly from your Directus flows. Perfect for notifications, alerts, updates, and more.

Repository

Screenshots

Here are some screenshots showing the extension in action:

  1. Operation in Flow Builder: Operation Listing

  2. Message Type Selection: Message Type

  3. Simple Message Configuration: Simple Configuration

  4. Simple Message Example: Simple Message Example

  5. Embed Templates: Embed Templates

  6. Embed Message Configuration: Embed Configuration

  7. Embed Message Example: Embed Message Example

Features

  • Simple Text Messages: Send plain text messages to any Discord channel or thread
  • Rich Embed Messages: Create beautiful, structured messages with:
    • Pre-designed templates (Basic, Success, Error, Info)
    • Custom titles and descriptions
    • Author information with name, icon, and URL
    • Thumbnail and main images
    • Custom fields with inline options
    • Footer text and icon
    • Timestamp
  • Dynamic Templates:
    • 🟦 Basic Embed - Clean, professional blue theme (#3498DB)
    • 🟩 Success Notification - Positive green theme (#57F287)
    • 🟥 Error Notification - Alert red theme (#ED4245)
    • ⬜️ Information Update - Informative cyan theme (#3498DB)
  • Secure Token Handling: Bot token is stored securely using Directus's password field type

Requirements

  • Directus version ^10.1.11
  • Node.js version >=18.0.0
  • A Discord bot with:
    • Send Messages permission
    • Embed Links permission (for rich embeds)

Installation

# Using npm
npm install directus-extension-discord-operation

# Using yarn
yarn add directus-extension-discord-operation

# Using pnpm
pnpm add directus-extension-discord-operation

Discord Bot Setup

  1. Create a Discord Application:

    • Go to Discord Developer Portal
    • Click "New Application" and give it a name
    • Navigate to the "Bot" section
    • Click "Add Bot"
    • Copy the bot token (you'll need this later)
  2. Invite the Bot to Your Server:

    • Go to the "OAuth2" section
    • In "Scopes", select "bot"
    • In "Bot Permissions", select:
      • Send Messages
      • Embed Links
    • Copy the generated URL and open it in a browser
    • Select your server and authorize the bot
  3. Get Channel/Thread ID:

    • Enable Developer Mode in Discord (User Settings > App Settings > Advanced)
    • Right-click on the channel/thread
    • Click "Copy ID"

Usage in Flows

  1. Add Operation:

    • In your Directus flow, click "Add Operation"
    • Select "Send Discord Message"
  2. Configure Basic Settings:

    • Enter the Channel/Thread ID
    • Choose Message Type:
      • Simple Message
      • Embed Message
  3. For Simple Messages:

    • Just enter your text message
  4. For Embed Messages:

    • Choose a template (Basic, Success, Error, Info)
    • Set Title and Description
    • Optional: Configure additional elements:
      • Author information
      • Images
      • Fields
      • Footer
      • Timestamp
  5. Add Bot Token:

    • Enter your Discord bot token
    • The token is stored securely

Embed Fields Format

When adding fields to your embed, use JSON array format:

[
  {
    "name": "Field Title",
    "value": "Field Value",
    "inline": true
  },
  {
    "name": "Another Field",
    "value": "More information",
    "inline": false
  }
]

Examples

Simple Message

{
  "channelId": "YOUR_CHANNEL_ID",
  "messageType": "simple",
  "message": "Hello from Directus!",
  "token": "YOUR_BOT_TOKEN"
}

Success Embed

{
  "channelId": "YOUR_CHANNEL_ID",
  "messageType": "embed",
  "embedTemplate": "success",
  "embedTitle": "Operation Successful",
  "embedDescription": "The backup process completed successfully.",
  "embedFields": "[{\"name\": \"Time\", \"value\": \"5 minutes\", \"inline\": true}, {\"name\": \"Size\", \"value\": \"1.2GB\", \"inline\": true}]",
  "embedTimestamp": true,
  "token": "YOUR_BOT_TOKEN"
}

Troubleshooting

Common issues and solutions:

  1. Message Not Sending

    • Verify bot token is correct
    • Check if bot has required permissions
    • Ensure channel/thread ID is correct
  2. Embed Not Showing

    • Verify bot has "Embed Links" permission
    • Check JSON format for fields
    • Ensure URLs are valid for images
  3. Fields Not Appearing

    • Verify JSON array format is correct
    • Maximum 25 fields per embed
    • Field name and value are required

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Kashyap Thakar