notifkit 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +94 -0
- package/dist/index.d.mts +9973 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +38 -0
- package/dist/index.mjs.map +1 -0
- package/dist/main-4H6vNXvy.mjs +392 -0
- package/dist/main-4H6vNXvy.mjs.map +1 -0
- package/dist/main-BHYZfBBq.mjs +224 -0
- package/dist/main-BHYZfBBq.mjs.map +1 -0
- package/dist/main-BIcKzWHE.mjs +430 -0
- package/dist/main-BIcKzWHE.mjs.map +1 -0
- package/dist/main-ClEeP5qw.mjs +629 -0
- package/dist/main-ClEeP5qw.mjs.map +1 -0
- package/dist/main-D-oWWzR3.mjs +234 -0
- package/dist/main-D-oWWzR3.mjs.map +1 -0
- package/dist/main-Dlfy9mWs.mjs +571 -0
- package/dist/main-Dlfy9mWs.mjs.map +1 -0
- package/dist/main-Dztc2dqR.mjs +294 -0
- package/dist/main-Dztc2dqR.mjs.map +1 -0
- package/dist/main-Ok9cQJ7q.mjs +1636 -0
- package/dist/main-Ok9cQJ7q.mjs.map +1 -0
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/dist/src-DrSN2wCg.mjs +3424 -0
- package/dist/src-DrSN2wCg.mjs.map +1 -0
- package/drizzle/0000_spotty_jack_flag.sql +189 -0
- package/drizzle/0001_stale_shotgun.sql +17 -0
- package/drizzle/meta/0000_snapshot.json +1314 -0
- package/drizzle/meta/0001_snapshot.json +1460 -0
- package/drizzle/meta/_journal.json +20 -0
- package/package.json +110 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 devkitshq
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# notifkit
|
|
4
|
+
|
|
5
|
+
**Self-hosted notification infrastructure.**
|
|
6
|
+
One call delivers to email, SMS, push, and webhook — routed by preference, quiet hours, and consent.
|
|
7
|
+
|
|
8
|
+
[Documentation](https://notifkit.dev/docs/) · [Quickstart](https://notifkit.dev/docs/quickstart.html) · [Examples](https://notifkit.dev/docs/examples.html) · [notifkit.dev](https://notifkit.dev)
|
|
9
|
+
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install notifkit
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Node 22+, PostgreSQL, and Redis. Migrations ship in the package — point drizzle-kit at
|
|
21
|
+
`node_modules/notifkit/drizzle` — and in development notifkit starts throwaway Postgres
|
|
22
|
+
and Redis containers for you, so Docker is the only prerequisite to try it.
|
|
23
|
+
|
|
24
|
+
## What it does
|
|
25
|
+
|
|
26
|
+
Shipping one notification is easy. Shipping a notification _system_ is not: you end up with queues, retry logic, a preference store, quiet-hours maths, provider adapters, and a dead-letter queue nobody wants to own.
|
|
27
|
+
|
|
28
|
+
notifkit is that machinery, running on your servers. You describe **who** needs to know **what**; it works out **how** — the right channel, at a decent hour, only to people who said yes.
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
await notifkit.notify({
|
|
32
|
+
user: "usr_123",
|
|
33
|
+
template: "order-shipped",
|
|
34
|
+
channels: ["push", "email"],
|
|
35
|
+
fallback: true, // push first; email only if push fails
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
That call returns immediately. Behind it: preference and consent filtering, timezone-aware quiet hours, per-user throttling, template rendering, provider dispatch with retries and circuit breakers, and a durable log of what happened.
|
|
40
|
+
|
|
41
|
+
| | |
|
|
42
|
+
| ----------------- | ----------------------------------------------------------------------------------- |
|
|
43
|
+
| **Channels** | `email`, `sms`, `push`, `webhook` |
|
|
44
|
+
| **Targeting** | A user, a list of users, a segment, or a topic |
|
|
45
|
+
| **Priorities** | `low`, `normal`, `high`, `critical` — separate stream lanes |
|
|
46
|
+
| **Scheduling** | Future sends with `sendAt`, quiet-hours deferral, cancel before dispatch |
|
|
47
|
+
| **Preferences** | Per-user channel and topic opt-outs, quiet hours, contact-level overrides |
|
|
48
|
+
| **Workflows** | Multi-step sequences with `wait`, `waitForEvent`, and `notify` steps |
|
|
49
|
+
| **Reliability** | Redis Streams, 24h idempotency, backoff retries, DLQ, provider circuit breakers |
|
|
50
|
+
| **Templates** | `{{var}}` interpolation with escaping decided by the destination field |
|
|
51
|
+
| **AI** | Optional LLM augmentation before render, via the Vercel AI SDK |
|
|
52
|
+
| **Multi-tenancy** | Projects with isolated keys, data, and rate limits |
|
|
53
|
+
| **Consent** | RFC 8058 one-click unsubscribe; complaints and hard bounces suppress automatically |
|
|
54
|
+
| **Reporting** | Tag a send with a `campaign` label, then read delivery and engagement totals back |
|
|
55
|
+
| **Agents** | An MCP server ([`@notifkit/mcp`](./packages/mcp)) driving all of it from a terminal |
|
|
56
|
+
| **Observability** | Prometheus `/metrics`, `/health`, `/live`, `/ready`, and a queryable delivery log |
|
|
57
|
+
|
|
58
|
+
Bring your own provider accounts — first-party packages ship for Resend and Firebase Cloud Messaging, and anything else is one `Transport` class with a `send()` method. Your keys, your billing, your deliverability.
|
|
59
|
+
|
|
60
|
+
**Requirements:** Node 22+, PostgreSQL, Redis. In development notifkit starts throwaway Postgres and Redis containers for you, so the only prerequisite to try it is Docker.
|
|
61
|
+
|
|
62
|
+
**What it is not:** a marketing automation suite. It is infrastructure for product notifications.
|
|
63
|
+
|
|
64
|
+
## Documentation
|
|
65
|
+
|
|
66
|
+
Everything lives at **[notifkit.dev/docs](https://notifkit.dev/docs/)**.
|
|
67
|
+
|
|
68
|
+
| | |
|
|
69
|
+
| ------------------------------------------------------------------------------ | ---------------------------------------------------------- |
|
|
70
|
+
| [Quickstart](https://notifkit.dev/docs/quickstart.html) | Install to first delivered notification, about ten minutes |
|
|
71
|
+
| [How it works](https://notifkit.dev/docs/concepts.html) | The five nouns and the pipeline they move through |
|
|
72
|
+
| [Channels & fallback](https://notifkit.dev/docs/guides/routing.html) | Multicast, ordered fallback, writing a transport |
|
|
73
|
+
| [Preferences & quiet hours](https://notifkit.dev/docs/guides/preferences.html) | The four gates every notification passes |
|
|
74
|
+
| [Templates & AI](https://notifkit.dev/docs/guides/templates.html) | Interpolation, escaping, per-channel content |
|
|
75
|
+
| [Segments & scheduling](https://notifkit.dev/docs/guides/segments.html) | Fan-out, priority lanes, `sendAt`, idempotency |
|
|
76
|
+
| [Workflows](https://notifkit.dev/docs/guides/workflows.html) | Multi-step sequences, recurring sends, digests |
|
|
77
|
+
| [Examples](https://notifkit.dev/docs/examples.html) | The five runnable projects in [`examples/`](./examples) |
|
|
78
|
+
| [Architecture](https://notifkit.dev/docs/architecture.html) | Streams, delivery guarantees, topologies, data model |
|
|
79
|
+
| [Deployment](https://notifkit.dev/docs/deployment.html) | Dockerfile, Compose, splitting API from workers |
|
|
80
|
+
| [Operations](https://notifkit.dev/docs/operations.html) | Health, metrics, the DLQ, key rotation, shutdown |
|
|
81
|
+
| [Reference](https://notifkit.dev/docs/reference.html) | Every endpoint, payload shape, and SDK method |
|
|
82
|
+
| [MCP server](https://notifkit.dev/docs/mcp.html) | Send and report on campaigns from a terminal agent |
|
|
83
|
+
|
|
84
|
+
## Star the repo
|
|
85
|
+
|
|
86
|
+
If notifkit saves you a month or two you were about to spend building this yourself, **[give it a star](https://github.com/devkitshq/notifkit)** — it is the cheapest way to help other people find it.
|
|
87
|
+
|
|
88
|
+
## Contributing
|
|
89
|
+
|
|
90
|
+
Issues and pull requests are welcome. `npm install && npm run build`, then `npm test` — the suite starts its own Postgres and Redis containers, so Docker is the only thing you need running.
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
MIT. Do what you like with it, including commercially. See [LICENSE](./LICENSE).
|