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

@apollo-deploy/adapter-slack

v2.0.0

Published

Slack adapter for Apollo Deploy integration hub

Readme

@apollo-deploy/adapter-slack

Slack adapter for the Apollo Deploy integration hub — messaging with OAuth 2.0 and HMAC-SHA256 + timestamp anti-replay webhook verification.

Note: This adapter was originally built for the Apollo Deploy platform. We are converting the SDK into a fully generalized, provider-agnostic integration framework that any team can use — independent of Apollo Deploy. The adapter API is designed to be portable and usable standalone or with any hub implementation.

Installation

bun add @apollo-deploy/adapter-slack

Prerequisites

  1. Go to api.slack.com/appsCreate New App → From scratch
  2. Under OAuth & Permissions, add your Redirect URL and the required Bot Token Scopes (e.g. channels:read, chat:write, chat:write.public)
  3. Under Basic Information, copy the Client ID, Client Secret, and Signing Secret
  4. For events: under Event Subscriptions, enable events and add your webhook URL

Configuration

import { createSlackAdapter } from '@apollo-deploy/adapter-slack';

const slack = createSlackAdapter({
  clientId: process.env.SLACK_CLIENT_ID!,
  clientSecret: process.env.SLACK_CLIENT_SECRET!,
  signingSecret: process.env.SLACK_SIGNING_SECRET!,
  // scopes: ['channels:read', 'chat:write'],         // default bot scopes for OAuth flow
  // userScopes: ['channels:history'],                 // optional user scopes
});

Options

| Option | Type | Required | Description | |--------|------|----------|-------------| | clientId | string | ✅ | Slack App Client ID | | clientSecret | string | ✅ | Slack App Client Secret | | signingSecret | string | ✅ | Slack App Signing Secret — used to verify X-Slack-Signature | | scopes | string[] | No | Default bot token scopes to request during OAuth | | userScopes | string[] | No | Default user token scopes to request during OAuth |

Environment variables

SLACK_CLIENT_ID=1234567890.9876543210
SLACK_CLIENT_SECRET=abc123def456ghi789
SLACK_SIGNING_SECRET=xyz987...

Registering with the hub

import { IntegrationHub } from '@apollo-deploy/integrations';
import { createSlackAdapter } from '@apollo-deploy/adapter-slack';

const hub = new IntegrationHub();

hub.register('slack', createSlackAdapter({
  clientId: process.env.SLACK_CLIENT_ID!,
  clientSecret: process.env.SLACK_CLIENT_SECRET!,
  signingSecret: process.env.SLACK_SIGNING_SECRET!,
}));

await hub.initialize();

Webhook handler

export async function POST(req: Request) {
  const rawBody = Buffer.from(await req.arrayBuffer());
  const headers = Object.fromEntries(req.headers.entries());

  // Slack sends a url_verification challenge on first setup — handled automatically
  const result = await hub.webhooks.slack({ rawBody, headers });

  if (result.body) {
    return new Response(JSON.stringify(result.body), {
      status: result.statusCode ?? 200,
      headers: { 'Content-Type': 'application/json' },
    });
  }
  return Response.json({ ok: true }, { status: 200 });
}

Signature: X-Slack-Signature: v0=<hmac-sha256> with X-Slack-Request-Timestamp anti-replay (5-minute window)

Token lifecycle

| Field | Value | |-------|-------| | Expiry | Never (unless token rotation is enabled) | | Refreshable | No | | Rotates refresh token | No | | Requires distributed lock | No |

Slack bot tokens (xoxb-...) do not expire unless you explicitly enable token rotation in your app settings.

Capability: messaging

const msg = hub.getAdapter('slack').messaging!;

// List channels
const channels = await msg.listChannels(tokens);

// Send a plain text message
await msg.sendMessage(tokens, {
  channelId: 'C01234567',
  text: 'Deployment to production succeeded ✅',
});

// Send a rich Block Kit message
await msg.sendRichMessage(tokens, {
  channelId: 'C01234567',
  blocks: [
    {
      type: 'section',
      text: { type: 'mrkdwn', text: '*Deploy complete* — v1.2.3 is live' },
    },
  ],
});

// Update an existing message
await msg.updateMessage(tokens, {
  channelId: 'C01234567',
  messageId: '1720000000.123456',
  text: 'Updated text',
});

Development

bun run build
bun run typecheck
bun run test
bun run dev
bun run clean