
Product
A New Overview in our Dashboard
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.
webhook-builder
Advanced tools
With NPM
$ npm install webhook-builder
With yarn
$ yarn add webhook-builder
/* ================================================================================= */
// Example //
/* ================================================================================= */
// Make sure you require the file.
// e.g: const { Webhook, MessageBuilder } = require("webhook-builder");
const webhook = new Webhook("your webhook url here");
// If you want to set a username and an icon/avatar for the webhook. Do this:
webhook.setWebhook({
username: "Your webhook username",
avatar_url: "Your avatar/icon URL",
});
// MessageBuilder (Object)
const mb = new MessageBuilder("Your content here", {
title: "Hello World!",
description: "This is a description",
color: "#fff",
});
// MessageBuilder (methods)
const mb = new MessageBuilder("Your content here")
.setTitle("Hello World!")
.setDescription("This is a description")
.setColor("#fff");
// Sending the webhook (Without promise prototypes)
webhook.send(mb);
// Sending the webhook (with promise prototypes)
webhook
.send(mb)
.then(() => {
console.log("The webhook has been sended successfully!");
})
.catch((err) => {
// Throws an error, if there is an error sending the webhook
throw new Error(err);
});
setWebhook
send
// But this is valid webhook.send(null, mb);
// And this webhook.send("Hello World!");
setTitle
setURL
setDescription
setColor
setAuthor
setThumbnail
setField
setFooter - footerText: "String" - footerIcon (optional): "String" | "URL"
FAQs
Build a webhook with this package
The npm package webhook-builder receives a total of 0 weekly downloads. As such, webhook-builder popularity was classified as not popular.
We found that webhook-builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.