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

@emito/provider-slack

v0.1.0

Published

Slack provider plugin for Emito.

Readme

@emito/provider-slack

Slack Incoming Webhook delivery adapter for the Emito notification engine.

License Types

TypeScript

What it is

@emito/provider-slack is the Slack channel provider for Emito. It implements the ProviderPlugin contract from @emito/types and delivers messages by POSTing a JSON payload to a Slack Incoming Webhook URL. The payload carries both blocks (Slack Block Kit) and a text fallback, and HTTP failures are mapped onto Emito's typed EmitoError codes so the engine can decide whether to retry.

The provider holds no credentials of its own — the destination webhookUrl arrives per delivery in the channel params, so a single provider instance serves every tenant and every workspace.

Install

@emito/provider-slack is a workspace package in the Emito monorepo and is not yet published to npm. Inside the monorepo, depend on it with the workspace protocol:

// package.json
{
  "dependencies": {
    "@emito/provider-slack": "workspace:*"
  }
}

@emito/types is a workspace dependency and resolves through the workspace. Standalone publishing to npm is planned.

Usage

import { createSlackProvider } from "@emito/provider-slack";

const slack = createSlackProvider();

const result = await slack.deliver({
  channel: "slack",
  webhookUrl: "https://hooks.slack.com/services/T000/B000/XXXX",
  text: "Build #1429 passed",
  blocks: [
    {
      type: "section",
      text: { type: "mrkdwn", text: "*Build #1429* passed :white_check_mark:" },
    },
  ],
  metadata: {
    notificationId: "ntf_123",
    subscriberId: "sub_456",
    eventType: "build.passed",
  },
});

// result.success === true on a 2xx response from Slack

Within Emito you register the provider with the engine rather than calling deliver directly; the engine resolves the slack channel to this plugin.

Injecting a custom fetch

createSlackProvider accepts an optional fetchFn so you can supply your own fetch implementation — useful for tests, instrumentation, or a non-global client.

const slack = createSlackProvider({ fetchFn: myFetch });

Request deadline

Every request carries a 10 second deadline so a stalled webhook cannot hold a delivery worker open indefinitely. Override it with timeoutMs:

const slack = createSlackProvider({ timeoutMs: 3_000 });

API surface

| Export | Kind | Description | | --- | --- | --- | | createSlackProvider(options?) | function | Builds a ProviderPlugin with name/channel set to "slack". | | options.fetchFn | typeof fetch (optional) | Custom fetch implementation; defaults to globalThis.fetch. | | options.timeoutMs | number (optional) | Per-request deadline; defaults to 10_000. |

The returned ProviderPlugin exposes:

| Member | Signature | Behavior | | --- | --- | --- | | deliver | (params: ChannelDeliveryParams) => Promise<DeliveryResult> | POSTs { blocks, text } to webhookUrl; resolves { success: true } on a 2xx response, throws an EmitoError otherwise. | | healthCheck | () => Promise<boolean> | Always resolves true (webhook delivery is stateless). |

Error mapping

Non-2xx responses are translated into EmitoError instances with codes from @emito/types, carrying the retry hint the engine uses:

| HTTP status | EMITO_ERROR_CODE | Retryable | | --- | --- | --- | | 429 | RATE_LIMITED | yes | | 404 | DELIVERY_INVALID_ADDRESS | no | | 5xx | PROVIDER_UNAVAILABLE | yes | | other non-2xx | DELIVERY_REJECTED | no |

A request that exceeds the deadline becomes a retryable PROVIDER_TIMEOUT. Other network-level failures (a rejected fetch) become a retryable PROVIDER_UNAVAILABLE error carrying the original as cause.

Part of Emito

@emito/provider-slack is one package in the Emito monorepo — self-hosted, provider-agnostic notification infrastructure for Node.js and TypeScript.

License

MIT — part of the Emito project.