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

@sathergate/notifykit

v0.1.0

Published

Unified notifications for Next.js. Any provider.

Downloads

62

Readme

notifykit

Unified notifications for Next.js. Any provider.

Send SMS, email, and push notifications through a single API. Provider-agnostic with adapters for Twilio, AWS SNS, Resend, and easy custom providers.

Install

npm install notifykit

Quick Start

import { createHerald } from "notifykit";
import { createTwilioProvider } from "notifykit/adapters/twilio";
import { createResendProvider } from "notifykit/adapters/resend";

const herald = createHerald({
  providers: [
    createTwilioProvider({
      accountSid: process.env.TWILIO_ACCOUNT_SID!,
      authToken: process.env.TWILIO_AUTH_TOKEN!,
      from: "+15551234567",
    }),
    createResendProvider({
      apiKey: process.env.RESEND_API_KEY!,
      from: "[email protected]",
    }),
  ],
});

// Send an SMS
await herald.send({
  to: "+15559876543",
  channel: "sms",
  body: "Your order has shipped!",
});

// Send an email
await herald.send({
  to: "[email protected]",
  channel: "email",
  subject: "Order Confirmation",
  body: "Thank you for your purchase.",
});

Providers

Twilio (SMS)

import { createTwilioProvider } from "notifykit/adapters/twilio";

const twilio = createTwilioProvider({
  accountSid: "AC...",
  authToken: "your-auth-token",
  from: "+15551234567",
});

Uses the Twilio REST API directly via fetch. No SDK dependency.

AWS SNS (Push)

import { SNSClient, PublishCommand } from "@aws-sdk/client-sns";
import { createSNSProvider } from "notifykit/adapters/sns";

const sns = createSNSProvider(
  { region: "us-east-1" },
  { SNSClient, PublishCommand },
);

You provide the AWS SDK classes. Herald stays lightweight.

Resend (Email)

import { createResendProvider } from "notifykit/adapters/resend";

const resend = createResendProvider({
  apiKey: "re_...",
  from: "[email protected]",
});

Uses the Resend REST API directly via fetch. No SDK dependency.

Custom Provider

import type { NotificationProvider } from "notifykit";

const myProvider: NotificationProvider = {
  channel: "sms",
  async send(notification) {
    // Your logic here
    return { success: true, channel: "sms", messageId: "abc" };
  },
};

Templates

Define templates with {{variable}} placeholders:

const herald = createHerald({
  providers: [twilio, resend],
  templates: {
    "order-shipped": {
      channel: "sms",
      body: "Hi {{name}}, your order #{{orderId}} has shipped!",
    },
    "welcome-email": {
      channel: "email",
      subject: "Welcome, {{name}}!",
      body: "Thanks for joining us, {{name}}. Get started at {{url}}.",
    },
  },
});

await herald.notify("order-shipped", {
  to: "+15559876543",
  data: { name: "Alice", orderId: "12345" },
});

React Hooks

import { HeraldProvider, useHerald, useNotification } from "notifykit/react";

function App() {
  return (
    <HeraldProvider herald={herald}>
      <NotifyButton />
    </HeraldProvider>
  );
}

function NotifyButton() {
  const { send, isSending } = useHerald();

  return (
    <button
      disabled={isSending}
      onClick={() =>
        send({ to: "+15559876543", channel: "sms", body: "Hello!" })
      }
    >
      Send SMS
    </button>
  );
}

function StatusAwareButton() {
  const { send, status, error } = useNotification();

  return (
    <div>
      <button
        onClick={() =>
          send({ to: "[email protected]", channel: "email", subject: "Hi", body: "Hello!" })
        }
      >
        Send
      </button>
      {status === "sending" && <p>Sending...</p>}
      {status === "sent" && <p>Sent!</p>}
      {status === "error" && <p>Error: {error}</p>}
    </div>
  );
}

Next.js API Routes

// app/api/notify/route.ts
import { createNotificationHandler } from "notifykit/next";
import { herald } from "@/lib/herald";

export const POST = createNotificationHandler(herald);
// app/api/webhooks/notifications/route.ts
import { createWebhookHandler } from "notifykit/next";

export const POST = createWebhookHandler({
  verify: (request, body) => {
    // Verify webhook signature
    return true;
  },
  onStatus: async (event) => {
    console.log(`Message ${event.messageId}: ${event.status}`);
  },
});

Building Custom Providers

Implement the NotificationProvider interface:

import type { NotificationProvider, Notification, SendResult } from "notifykit";

export function createMyProvider(config: MyConfig): NotificationProvider {
  return {
    channel: "sms", // or "email" or "push"
    async send(notification: Notification): Promise<SendResult> {
      // Send the notification using your service
      return {
        success: true,
        channel: "sms",
        messageId: "unique-id",
      };
    },
  };
}

License

MIT