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

@weaveintel/notifications

v0.1.2

Published

Notification channels, dispatcher, and target store for the weaveIntel platform. Supports webhook, web-push, APNs, and FCM.

Readme

@weaveintel/notifications

A pluggable notification system — channels (in-app, email/webhook, web-push, APNs, FCM), a dispatcher that fans out to them, and a store of who to reach.

Why it exists

"Tell the user their run finished" sounds like one line of code until you ask how: an in-app badge, an email, a phone push, a webhook to another system — and only to the devices this user actually still has. It's like a post office: you hand over one message, and the sorting room figures out every address it needs to reach and picks the right carrier for each. This package is that sorting room. You register the channels you support, store each user's targets, and the dispatcher fans a single notification out to all the right places — with suppression rules so you don't spam someone twice.

When to reach for it

Reach for it when your server needs to deliver notifications across more than one channel and wants a clean seam between "what happened" and "how it's delivered." It's storage-agnostic: an in-memory target store ships for tests, and you provide a KeyValueStore or SQL adapter for production. If you only need the client-side in-app feed rendering, that lives in your UI; this package owns the server fan-out and the durable feed store behind it.

How to use it

import {
  createWebhookChannel, createChannelRegistry,
  createMemoryTargetStore, createNotificationDispatcher,
} from '@weaveintel/notifications';

const channels = createChannelRegistry([createWebhookChannel({ /* ... */ })]);
const targets = createMemoryTargetStore();
await targets.create({ userId: 'u1', channelId: 'webhook', address: 'https://hooks.example.com/x' });

const dispatcher = createNotificationDispatcher({ channels, targets });
await dispatcher.dispatch({ userId: 'u1', title: 'Run finished', body: 'Your summary is ready.' });

Store the inbox in a real database (Postgres)

The in-app feed (the 🔔 with a red badge) is the one notification channel that stays — it's the durable record a user sees. createInMemoryFeedStore is great for tests; createPostgresNotificationFeedStore is the same NotificationFeedStore port backed by Postgres, so a restart doesn't lose anyone's inbox. Hand it a pg.Pool (share one across your app — e.g. from weaveSharedPostgres); it creates its table on first use.

import pg from 'pg';
import { createPostgresNotificationFeedStore } from '@weaveintel/notifications';

const feed = createPostgresNotificationFeedStore({ pool: new pg.Pool({ connectionString: process.env.DATABASE_URL }) });

await feed.append({ id: 'n1', tenantId: 't1', principalId: 'alice', category: 'run', title: 'Run finished', priority: 'normal', createdAt: Date.now(), readAt: null });
await feed.unreadCount('t1', 'alice'); // → 1 (the badge number)
await feed.markAllRead('t1', 'alice');

Two things it gets right that matter at scale. Dedupe: if your delivery pipeline runs twice (it's at-least-once by design), a stable dedupeKey collapses the two into one inbox row — enforced by a partial unique index, so even 50 concurrent redeliveries produce exactly one row. Isolation: every read is scoped to (tenant, principal), so one user never sees another's notifications. The same contract test the in-memory version passes runs against Postgres, and it's proven on a real fan-out to 5,000 recipients.

What's in the box

| Group | Exports | | --- | --- | | Channels | createWebhookChannel, createWebPushChannel, createApnsChannel, createFcmChannel | | Registry | createChannelRegistry | | Targets | createMemoryTargetStore, createKvTargetStore | | Dispatcher | createNotificationDispatcher (with SuppressionPolicy, DispatchResult, DispatchOptions) | | In-app feed | createInAppChannel, createInMemoryFeedStore, createPostgresNotificationFeedStore, INAPP_CHANNEL_ID, notificationFeedStoreContract | | Bus subscriptions | bindRunNotifications, bindTaskNotifications |

License

MIT.