# @slack/web-api

> Official library for using the Slack Platform's Web API

Latest version **8.2.0** (published 2026-09-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @slack/web-api
pnpm add @slack/web-api
yarn add @slack/web-api
bun add @slack/web-api
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 8.2.0 |
| Published | 2026-09-30 |
| First published | 2019-03-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 20 |
| Dependencies | 8 |
| Unpacked size | 2.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 3378 |
| Author | Slack Technologies, LLC |
| Maintainers | slackhq, ajm, sgorbach0v, stevegill, slack_biztech, misscoded, mwbrooks, cchensh, sspencer-slack, evegeris, e-zim, farhanjk |
| Keywords | slack, web-api, bot, client, http, api, proxy, rate-limiting, pagination |

## Links

- npm: https://www.npmjs.com/package/@slack/web-api
- Repository: https://github.com/slackapi/node-slack-sdk
- Homepage: https://docs.slack.dev/tools/node-slack-sdk/web-api/
- Issues: https://github.com/slackapi/node-slack-sdk/issues
- npm.io page: https://npm.io/package/@slack/web-api

## Dependencies (8)

- [retry](https://npm.io/package/retry.md) ^0.13.1
- [p-queue](https://npm.io/package/p-queue.md) ^6.6.2
- [p-retry](https://npm.io/package/p-retry.md) ^4.6.2
- [@types/node](https://npm.io/package/@types/node.md) >=20
- [@slack/types](https://npm.io/package/@slack/types.md) ^3.2.0
- [@types/retry](https://npm.io/package/@types/retry.md) 0.12.5
- [@slack/logger](https://npm.io/package/@slack/logger.md) ^5.0.0
- [eventemitter3](https://npm.io/package/eventemitter3.md) ^5.0.1

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 8.2.0 (latest) — 2026-09-30
- 8.0.0-rc.2 (rc) — 2026-07-13
- 7.10.1-featWorkObjectsBeta.1 (feat-work-objects) — 2025-04-10
- 8.1.1 — 2026-08-27
- 8.1.0 — 2026-08-27
- 8.0.0 — 2026-07-14
- 7.19.0 — 2026-07-06
- 7.18.0 — 2026-06-30
- 7.17.0 — 2026-06-11
- 7.16.0 — 2026-05-14
- 8.0.0-rc.1 — 2026-05-13
- 7.15.2 — 2026-05-04
- 7.15.1 — 2026-04-13
- 7.15.0 — 2026-03-13
- 7.14.1 — 2026-02-13
- … 92 more at https://npm.io/package/@slack/web-api/versions

## README

# Node Slack SDK

[![build-ci](https://github.com/slackapi/node-slack-sdk/actions/workflows/ci-build.yml/badge.svg)](https://github.com/slackapi/node-slack-sdk/actions/workflows/ci-build.yml)
<!-- TODO: npm versions with scoped packages: https://github.com/rvagg/nodei.co/issues/24 -->
___

## Getting Started

Visit the [documentation site](https://docs.slack.dev/tools/node-slack-sdk/) for all the lovely details.

_This SDK is a collection of single-purpose packages. The packages are aimed at making building Slack apps
easy, performant, secure, and scalable. They can help with just about anything in the Slack platform, from dropping
notifications in channels to fully interactive bots._

The Slack platform offers several APIs to build apps. Each Slack API delivers part of the capabilities from the
platform, so that you can pick just those that fit for your needs. This SDK offers a corresponding package for each of
Slack's APIs. They are small and powerful when used independently, and work seamlessly when used together, too.

**Just starting out?** The [Getting Started tutorial](https://docs.slack.dev/tools/node-slack-sdk/getting-started) will
walk you through building your first Slack app using Node.js.

| Slack API    | Use | NPM Package      |
|--------------|--------------|-------------------|
| Web API      | Send data to or query data from Slack using any of [over 270 methods](https://docs.slack.dev/reference/methods). | [`@slack/web-api`](https://docs.slack.dev/tools/node-slack-sdk/web-api) |
| OAuth        | Set up the authentication flow using V2 OAuth for Slack apps as well as V1 OAuth for classic Slack apps. | [`@slack/oauth`](https://docs.slack.dev/tools/node-slack-sdk/oauth) |
| Incoming Webhooks | Send notifications to a single channel which the user picks on installation. | [`@slack/webhook`](https://docs.slack.dev/tools/node-slack-sdk/webhook) |
| Socket Mode  | Listen for incoming messages and a limited set of events happening in Slack, using WebSocket. | [`@slack/socket-mode`](https://docs.slack.dev/tools/node-slack-sdk/socket-mode) |

**Not sure about which APIs are right for your app?** Read our [blog
post](https://medium.com/slack-developer-blog/getting-started-with-slacks-apis-f930c73fc889) that explains the options.
If you're still not sure, [reach out for help](#getting-help) and our community can guide you.

## Installation

Use your favorite package manager to install any of the packages and save to your `package.json`:

```shell
$ npm install @slack/web-api @slack/socket-mode

# Or, if you prefer yarn
$ yarn add @slack/web-api @slack/socket-mode
```

## Usage

The following examples summarize the most common ways to use this package. There's also a [Getting Started
tutorial](https://docs.slack.dev/tools/node-slack-sdk/getting-started) that's perfect for just starting out, and each
package's documentation, linked in the table above.

### Posting a message with Web API

Your app will interact with the Web API through the `WebClient` object, which is an export from `@slack/web-api`. You
typically instantiate a client with a token you received from Slack. The example below shows how to post a message into
a channel, DM, MPDM, or group. The `WebClient` object makes it simple to call any of the [**over 270 Web API
methods**](https://docs.slack.dev/reference/methods).

```javascript
import { WebClient } from '@slack/web-api';

// An access token (from your Slack app or custom integration - xoxp, xoxb)
const token = process.env.SLACK_TOKEN;

const web = new WebClient(token);

// This argument can be a channel ID, a DM ID, a MPDM ID, or a group ID
const conversationId = 'C1232456';

(async () => {
  // See: https://docs.slack.dev/reference/methods/chat.postMessage
  const res = await web.chat.postMessage({ channel: conversationId, text: 'Hello there' });

  // `res` contains information about the posted message
  console.log('Message sent: ', res.ts);
})();
```

**Note**: To use the example above, the token is required to have either the `bot`, `chat:user:write`, or
`chat:bot:write` scopes.

**Tip**: Use the [Block Kit Builder](https://api.slack.com/tools/block-kit-builder) for a playground
where you can prototype your message's look and feel.

### Listening for an event with the Events API

Refer to [Bolt for JavaScript document pages](https://docs.slack.dev/tools/bolt-js/concepts/event-listening).

### Responding to interactive messages

Refer to [Bolt for JavaScript document pages](https://docs.slack.dev/tools/bolt-js/concepts/actions).

### Using Socket Mode

Refer to [the module document page](https://docs.slack.dev/tools/node-slack-sdk/socket-mode) and [Bolt for JavaScript document page](https://docs.slack.dev/bolt-js/concepts/socket-mode).

## Requirements

This package supports Node v20 and higher. It's highly recommended to use [the latest LTS version of
node](https://github.com/nodejs/Release#release-schedule), and the documentation is written using syntax and features
from that version.

## Getting Help

If you get stuck, we're here to help. The following are the best ways to get assistance working through your issue:

  * [Issue Tracker](http://github.com/slackapi/node-slack-sdk/issues) for questions, feature requests, bug reports and
    general discussion related to these packages. Try searching before you create a new issue.
  * [Email us](mailto:developers@slack.com) in Slack developer support: `developers@slack.com`

---
_Source: https://npm.io/package/@slack/web-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
