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

@svforge/notifications

v2.0.1

Published

SVForge Notifications — persistent business notifications (read/unread)

Readme

@svforge/notifications

Persistent business notifications (read/unread, history) for SvelteForge dashboard projects. Distinct from ui_toast — a toast is ephemeral UI feedback; a notification is user data.

Install

npx sv add @svforge/notifications

Requires the dashboard template (auth + Drizzle). @svforge/realtime and @svforge/email are optional integrations.

Deployment profile

Supported: long-lived-node, serverless. Unsupported: edge, separate-worker because the module uses PostgreSQL. Realtime and email remain optional integrations.

Create

import { notificationsApi } from '$lib/server/notifications';

await notificationsApi.create({
	userId,
	type: 'export.ready',
	title: 'Export terminé',
	message: 'Votre export de paie est prêt.',
	actionUrl: `/exports/${exportId}`
});

Read / update

await notificationsApi.list(userId, { limit: 20 });
await notificationsApi.unreadCount(userId);
await notificationsApi.markAsRead(notificationId, userId);   // ownership-checked
await notificationsApi.markAllAsRead(userId);

UI

<NotificationsBell items unreadCount /> — badge with unread count, recent list, "mark all as read" (POST /api/notifications/read-all). Load data in a layout:

// +layout.server.ts
const items = await notificationsApi.list(locals.user.id, { limit: 10 });
const unreadCount = await notificationsApi.unreadCount(locals.user.id);

Optional: realtime (#229)

After a successful persist, publish a lightweight event — the client refetches; the DB stays the source of truth:

import { realtime } from '$lib/server/realtime';
await notificationsApi.create({ ... });
await realtime.publish({ channel: `user:${userId}`, event: 'notification.created', payload: { notificationId } });

Optional: email (#239/#236)

For specific types only (never all notifications): a job/route can check the type and call sendEmail from @svforge/email.

Model

{ id, userId, type, title, message, actionUrl?, metadata?, readAt?, createdAt }

message is plain text — no arbitrary HTML in v1.

What's included

  • $lib/server/notifications/schema.ts — Drizzle schema (notifications)
  • $lib/server/notifications/index.ts — create/list/unreadCount/markAsRead/markAllAsRead
  • $lib/components/svforge/ui/NotificationsBell.svelte — bell + badge + list
  • src/routes/api/notifications/read-all/+server.ts — mark-all endpoint

Limits (v1)

  • No push (web push / FCM) in v1 — delivery is in-app (bell) or via optional realtime/email integrations you wire yourself.
  • message is plain text (no rich content / HTML).
  • No per-notification preference engine (opt-in/out per type) in v1.

License

MIT