Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@slack/bolt

Package Overview
Dependencies
Maintainers
13
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@slack/bolt

A framework for building Slack apps, fast.

  • 4.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
13
Created

What is @slack/bolt?

@slack/bolt is a framework for building Slack apps using JavaScript. It simplifies the process of creating Slack apps by providing a set of tools and abstractions to handle common tasks such as event handling, command processing, and interactive components.

What are @slack/bolt's main functionalities?

Event Handling

This feature allows you to handle various Slack events such as messages, reactions, and more. The code sample demonstrates how to respond to a message event by sending a greeting.

const { App } = require('@slack/bolt');

const app = new App({
  token: 'xoxb-your-token',
  signingSecret: 'your-signing-secret'
});

app.event('message', async ({ event, say }) => {
  await say(`Hello, <@${event.user}>!`);
});

(async () => {
  await app.start(3000);
  console.log('⚡️ Bolt app is running!');
})();

Slash Commands

This feature allows you to create and handle custom slash commands in Slack. The code sample shows how to respond to a custom slash command `/hello` by sending a greeting.

const { App } = require('@slack/bolt');

const app = new App({
  token: 'xoxb-your-token',
  signingSecret: 'your-signing-secret'
});

app.command('/hello', async ({ command, ack, say }) => {
  await ack();
  await say(`Hello, <@${command.user_id}>!`);
});

(async () => {
  await app.start(3000);
  console.log('⚡️ Bolt app is running!');
})();

Interactive Components

This feature allows you to handle interactions with Slack's interactive components like buttons, select menus, and more. The code sample demonstrates how to respond to a button click interaction.

const { App } = require('@slack/bolt');

const app = new App({
  token: 'xoxb-your-token',
  signingSecret: 'your-signing-secret'
});

app.action('button_click', async ({ body, ack, say }) => {
  await ack();
  await say(`<@${body.user.id}> clicked the button!`);
});

(async () => {
  await app.start(3000);
  console.log('⚡️ Bolt app is running!');
})();

Other packages similar to @slack/bolt

Keywords

FAQs

Package last updated on 01 Nov 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc