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

@chat-adapter/slack

v4.6.0

Published

Slack adapter for chat

Downloads

9,597

Readme

@chat-adapter/slack

Slack adapter for the chat SDK.

Installation

npm install chat @chat-adapter/slack

Usage

import { Chat } from "chat";
import { createSlackAdapter } from "@chat-adapter/slack";

const chat = new Chat({
  userName: "mybot",
  adapters: {
    slack: createSlackAdapter({
      botToken: process.env.SLACK_BOT_TOKEN!,
      signingSecret: process.env.SLACK_SIGNING_SECRET!,
    }),
  },
});

// Handle @mentions
chat.onNewMention(async (thread, message) => {
  await thread.post("Hello from Slack!");
});

Configuration

| Option | Required | Description | |--------|----------|-------------| | botToken | Yes | Slack bot token (starts with xoxb-) | | signingSecret | Yes | Slack signing secret for webhook verification |

Environment Variables

SLACK_BOT_TOKEN=xoxb-...
SLACK_SIGNING_SECRET=...

Slack App Setup

1. Create a Slack App

  1. Go to api.slack.com/apps
  2. Click Create New AppFrom scratch
  3. Enter app name and select workspace
  4. Click Create App

2. Configure Bot Token Scopes

  1. Go to OAuth & Permissions in the sidebar
  2. Under ScopesBot Token Scopes, add:
    • app_mentions:read - Receive @mention events
    • channels:history - Read messages in public channels
    • channels:read - View basic channel info
    • chat:write - Send messages
    • groups:history - Read messages in private channels
    • groups:read - View basic private channel info
    • im:history - Read direct messages
    • im:read - View basic DM info
    • reactions:read - View emoji reactions
    • reactions:write - Add/remove emoji reactions
    • users:read - View user info (for display names)

3. Install App to Workspace

  1. Go to OAuth & Permissions
  2. Click Install to Workspace
  3. Authorize the app
  4. Copy the Bot User OAuth Token (starts with xoxb-) → SLACK_BOT_TOKEN

4. Get Signing Secret

  1. Go to Basic Information
  2. Under App Credentials, copy Signing SecretSLACK_SIGNING_SECRET

5. Configure Event Subscriptions

  1. Go to Event Subscriptions
  2. Toggle Enable Events to On
  3. Set Request URL to: https://your-domain.com/api/webhooks/slack
    • Slack will verify the URL immediately
  4. Under Subscribe to bot events, add:
    • app_mention - When someone @mentions your bot
    • message.channels - Messages in public channels
    • message.groups - Messages in private channels
    • message.im - Direct messages
  5. Click Save Changes

6. (Optional) Enable Interactivity

If you want to use buttons, modals, or other interactive components:

  1. Go to Interactivity & Shortcuts
  2. Toggle Interactivity to On
  3. Set Request URL to: https://your-domain.com/api/webhooks/slack

Features

  • Message posting and editing
  • Thread subscriptions
  • Reaction handling (add/remove/events)
  • File attachments
  • Rich cards (Block Kit)
  • Action callbacks (interactive components)
  • Direct messages

Troubleshooting

"Invalid signature" error

  • Verify SLACK_SIGNING_SECRET is correct
  • Check that the request timestamp is within 5 minutes (clock sync issue)

Bot not responding to messages

  • Verify Event Subscriptions are configured
  • Check that the bot has been added to the channel
  • Ensure the webhook URL is correct and accessible

License

MIT