https://github.com/better-notify/better-notify
Type-safe notification infrastructure for Node.js
https://github.com/better-notify/better-notify
better-notify cloudflare nodejs notifications notify orpc resend trpc typescript
Last synced: 25 days ago
JSON representation
Type-safe notification infrastructure for Node.js
- Host: GitHub
- URL: https://github.com/better-notify/better-notify
- Owner: better-notify
- License: mit
- Created: 2026-04-25T08:50:56.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-06T09:19:04.000Z (about 1 month ago)
- Last Synced: 2026-05-06T09:43:19.134Z (about 1 month ago)
- Topics: better-notify, cloudflare, nodejs, notifications, notify, orpc, resend, trpc, typescript
- Language: TypeScript
- Homepage: https://better-notify.com
- Size: 1.55 MB
- Stars: 7
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
End-to-end typed notification infrastructure for Node.js and Bun.
Website ·
Docs ·
Blog ·
Changelog
## Why Better-Notify?
- **Typed end-to-end** — one catalog type drives the client, queue worker, and webhook router. Schema and template can't silently drift.
- **Multi-channel** — email, SMS, push, Slack, Discord, Telegram, and more from the same pipeline. Define once, send anywhere.
- **Zero lock-in** — swap transports (SMTP, Resend, Mailchimp, Cloudflare Email) without touching business logic. Standard Schema means no hard Zod dependency either.
- **Batteries included** — middleware (rate-limit, idempotency, tracing, dry-run), hooks, plugins, and a logger built into core.
## Quick start
```sh
npm install @betternotify/core @betternotify/email zod
```
```ts
import { createNotify, createClient } from '@betternotify/core';
import { emailChannel, mockTransport } from '@betternotify/email';
import { z } from 'zod';
const email = emailChannel({ defaults: { from: 'hello@example.com' } });
const rpc = createNotify({ channels: { email } });
const catalog = rpc.catalog({
welcome: rpc
.email()
.input(z.object({ name: z.string() }))
.subject(({ input }) => `Welcome, ${input.name}`)
.template({ render: async ({ input }) => ({ html: `
Hi ${input.name}
` }) }),
});
const mail = createClient({
catalog,
transportsByChannel: { email: mockTransport() },
});
await mail.welcome.send({ to: 'john@example.com', input: { name: 'John' } });
```
## Packages
| Channel | Transport | Template |
| -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- |
| [`@betternotify/email`](https://www.npmjs.com/package/@betternotify/email) | [`@betternotify/smtp`](https://www.npmjs.com/package/@betternotify/smtp) | [`@betternotify/react-email`](https://www.npmjs.com/package/@betternotify/react-email) |
| [`@betternotify/sms`](https://www.npmjs.com/package/@betternotify/sms) | [`@betternotify/resend`](https://www.npmjs.com/package/@betternotify/resend) | [`@betternotify/mjml`](https://www.npmjs.com/package/@betternotify/mjml) |
| [`@betternotify/push`](https://www.npmjs.com/package/@betternotify/push) | [`@betternotify/mailchimp`](https://www.npmjs.com/package/@betternotify/mailchimp) | [`@betternotify/handlebars`](https://www.npmjs.com/package/@betternotify/handlebars) |
| [`@betternotify/webpush`](https://www.npmjs.com/package/@betternotify/webpush) | [`@betternotify/cloudflare-email`](https://www.npmjs.com/package/@betternotify/cloudflare-email) | |
| [`@betternotify/slack`](https://www.npmjs.com/package/@betternotify/slack) | [`@betternotify/twilio`](https://www.npmjs.com/package/@betternotify/twilio) | |
| [`@betternotify/discord`](https://www.npmjs.com/package/@betternotify/discord) | [`@betternotify/autosend`](https://www.npmjs.com/package/@betternotify/autosend) | |
| [`@betternotify/telegram`](https://www.npmjs.com/package/@betternotify/telegram) | [`@betternotify/onesignal`](https://www.npmjs.com/package/@betternotify/onesignal) | |
| [`@betternotify/whatsapp`](https://www.npmjs.com/package/@betternotify/whatsapp) | [`@betternotify/selligent`](https://www.npmjs.com/package/@betternotify/selligent) | |
| [`@betternotify/github`](https://www.npmjs.com/package/@betternotify/github) | | |
| [`@betternotify/zapier`](https://www.npmjs.com/package/@betternotify/zapier) | | |
Core: [`@betternotify/core`](https://www.npmjs.com/package/@betternotify/core) · Integrations: [`@betternotify/mcp`](https://www.npmjs.com/package/@betternotify/mcp)
Scaffolding: [`create-better-notify`](https://www.npmjs.com/package/create-better-notify)
```sh
npx create-better-notify@latest
```
---
## Star History
---
Created by Lucas Reis · X
MIT License