@dev0ph3r/netlify-plugin-discord
v1.0.2
Published
Discord webhook plugin for Netlify builds
Downloads
23
Maintainers
Readme
Netlify Discord Notification Plugin
This plugin sends deployment notifications to a Discord webhook, allowing you to track deployment statuses directly from your Discord channel.
Installation
To install the plugin in your Netlify project, follow these steps:
Navigate to your Netlify project directory.
Install the plugin as a dependency using npm or yarn:
npm install @dev0ph3r/netlify-plugin-discordor
yarn add @dev0ph3r/netlify-plugin-discordAdd the plugin to your
netlify.tomlconfiguration file:
[[plugins]]
package = "@dev0ph3r/netlify-plugin-discord"Configuration
The plugin requires two environment variables to function properly. You can set these variables in the Netlify UI.
Required Environment Variables
DISCORD_WEBHOOK_URL [^1] [^1]: (How to create a webhook in discord: https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks)
Description: The Discord webhook URL where notifications will be sent.
Example:
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/your-webhook-id/your-webhook-token
DISCORD_PLUGIN_LANGUAGE
Description: The language used in notifications.
Options:
EN(English) orFR(French). Defaults toENif not specified.Example:
DISCORD_PLUGIN_LANGUAGE=FR
Setting Environment Variables in Netlify
To configure the environment variables in Netlify:
Go to your site in the Netlify dashboard.
Navigate to Site settings > Environment variables.
Add the following variables:
DISCORD_WEBHOOK_URLDISCORD_PLUGIN_LANGUAGE
Save the changes.
Usage
Once the plugin is installed and the environment variables are set, it will automatically send deployment notifications to the specified Discord webhook during build events.
Notifications
Success Notification: Sent when the build and deployment succeed.
Error Notification: Sent when the build or deployment fails.
Both notifications include detailed information about the deployment, such as the site name, branch, build ID, and more.
License
This plugin is licensed under the MIT License. See the LICENSE file for details.
Contributions
Contributions are welcome! Feel free to open an issue or submit a pull request with improvements or fixes.
