notifkit 0.1.6 → 0.1.8
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/README.md +5 -17
- package/dashboard/README.md +29 -0
- package/dashboard/dist/assets/index-7mvXb4bS.js +310 -0
- package/dashboard/dist/assets/index-o7L-f3-c.css +1 -0
- package/dashboard/dist/favicon.svg +4 -0
- package/dashboard/dist/index.html +14 -0
- package/dist/index.d.mts +3435 -548
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{main-DDbquL89.mjs → main-0FHNtN5g.mjs} +2 -2
- package/dist/{main-DDbquL89.mjs.map → main-0FHNtN5g.mjs.map} +1 -1
- package/dist/{main-DdLzptZE.mjs → main-7KMlWnDx.mjs} +2 -2
- package/dist/{main-DdLzptZE.mjs.map → main-7KMlWnDx.mjs.map} +1 -1
- package/dist/{main-DsDkyBZi.mjs → main-B0BcY_JJ.mjs} +2 -2
- package/dist/{main-DsDkyBZi.mjs.map → main-B0BcY_JJ.mjs.map} +1 -1
- package/dist/{main-Db2f2-sW.mjs → main-BAO4kKce.mjs} +437 -63
- package/dist/main-BAO4kKce.mjs.map +1 -0
- package/dist/{main-DfrrNKp9.mjs → main-BjXgGJBd.mjs} +2 -2
- package/dist/{main-DfrrNKp9.mjs.map → main-BjXgGJBd.mjs.map} +1 -1
- package/dist/{main-BnIX5nfp.mjs → main-BtXITy0k.mjs} +2 -2
- package/dist/{main-BnIX5nfp.mjs.map → main-BtXITy0k.mjs.map} +1 -1
- package/dist/{main-CWGEKpLU.mjs → main-BxqAXTr6.mjs} +2 -2
- package/dist/{main-CWGEKpLU.mjs.map → main-BxqAXTr6.mjs.map} +1 -1
- package/dist/{main-Cwu4iQXc.mjs → main-zCpvA9Rx.mjs} +2 -2
- package/dist/{main-Cwu4iQXc.mjs.map → main-zCpvA9Rx.mjs.map} +1 -1
- package/dist/{src-CpUnBl_M.mjs → src-DkvHYM3y.mjs} +127 -41
- package/dist/src-DkvHYM3y.mjs.map +1 -0
- package/drizzle/0005_admin_users.sql +11 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +8 -3
- package/scripts/create-admin.mjs +67 -0
- package/src/client.ts +111 -40
- package/src/config/index.ts +3 -0
- package/src/contracts/sdk.ts +143 -3
- package/src/db/schema.ts +13 -0
- package/src/repositories/index.ts +82 -1
- package/src/services/api/admin-static.ts +224 -0
- package/src/services/api/handlers.ts +223 -42
- package/src/services/api/main.ts +72 -19
- package/src/services/auth/index.ts +103 -0
- package/dist/main-Db2f2-sW.mjs.map +0 -1
- package/dist/src-CpUnBl_M.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ flowchart TD
|
|
|
85
85
|
|
|
86
86
|
In a single process, the API and all workers run in the same Node.js process (`services: ["all"]`), which works for small and medium apps, side projects, and staging. Distributed, you run stateless API servers (`services: ["api"]`) behind a load balancer and scale worker pools (`services: ["enricher", "engine", "delivery", "scheduler"]`) horizontally across Redis Streams consumer groups.
|
|
87
87
|
|
|
88
|
-
## Quickstart
|
|
88
|
+
## Quickstart (needs 5 mins)
|
|
89
89
|
|
|
90
90
|
### 1. Install
|
|
91
91
|
|
|
@@ -123,6 +123,8 @@ await server.start();
|
|
|
123
123
|
console.log("notifkit listening on http://localhost:3000");
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
+
`from` is required on `ResendTransport` — it is the sender for any template that does not name its own, and it has to be an address on a domain you have verified in Resend. A template can override it with its own `from`, so one transport can serve both `no-reply@` receipts and `marketing@` campaigns.
|
|
127
|
+
|
|
126
128
|
`ADMIN_API_KEY` is the root credential. It is read from the environment, it is what mints project API keys in the next step, and without it the project-management routes answer `403`. Any string works locally:
|
|
127
129
|
|
|
128
130
|
```bash
|
|
@@ -173,8 +175,8 @@ await notifkit.syncTemplates({
|
|
|
173
175
|
],
|
|
174
176
|
});
|
|
175
177
|
|
|
176
|
-
// 2. Register a user
|
|
177
|
-
await notifkit.addUser({
|
|
178
|
+
// 2. Register a user (supports id + contacts array or object)
|
|
179
|
+
await notifkit.addUser("usr_123", [{ channel: "email", target: "alex@acme.com" }]);
|
|
178
180
|
|
|
179
181
|
// 3. Dispatch
|
|
180
182
|
await notifkit.notify({
|
|
@@ -263,20 +265,6 @@ notifkit is the durable notification layer that runs inside your own stack. It i
|
|
|
263
265
|
|
|
264
266
|
First-party providers cover Resend, Firebase Cloud Messaging, Slack, Twilio, Telegram, Discord, and WhatsApp. Anything else is a `Transport` class with a `send()` method.
|
|
265
267
|
|
|
266
|
-
### How this compares to Novu
|
|
267
|
-
|
|
268
|
-
Novu is the established open-source project in this space, and if you want a notification platform with a dashboard, a visual workflow editor, and a drop-in in-app inbox component, use Novu. It is more mature, has a much larger community, and solves a broader problem.
|
|
269
|
-
|
|
270
|
-
notifkit is a narrower, more embeddable take on the same layer:
|
|
271
|
-
|
|
272
|
-
- **A library first, a platform second.** notifkit is an npm package you can run inside your existing Node process. Novu self-hosts as a set of services (API, worker, WebSocket server, dashboard SPA) that you deploy and operate alongside your app.
|
|
273
|
-
- **Postgres, not MongoDB.** notifkit stores state in PostgreSQL with Drizzle migrations and queues in Redis Streams. If Postgres is already your database, there is no new datastore to run.
|
|
274
|
-
- **Workflows as code.** Multi-step sequences are typed TypeScript, versioned in your repo, rather than built in a visual editor.
|
|
275
|
-
- **MIT, all of it.** There is no open-core split. Novu is MIT at the core with enterprise features under a commercial license; notifkit has no feature held back from the self-hosted build.
|
|
276
|
-
- **MCP as a first-class interface.** Agents operate the same infrastructure your app uses, including triage and delivery-log inspection.
|
|
277
|
-
|
|
278
|
-
What notifkit does not have: an in-app notification center or inbox component, a web dashboard for non-engineers, digest aggregation, or Novu's provider catalog. If you need those, Novu is the better fit.
|
|
279
|
-
|
|
280
268
|
## Agent-operable
|
|
281
269
|
|
|
282
270
|
https://github.com/user-attachments/assets/4dff98bb-37d3-44b4-bf46-9607c1cd89b5
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Notifkit Admin & Observability Dashboard
|
|
2
|
+
|
|
3
|
+
This is the single-page application (SPA) admin console and real-time delivery observability dashboard for **Notifkit**, built with **Vite**, **React 19**, **React Router**, **Tailwind CSS v4**, and **shadcn/ui**.
|
|
4
|
+
|
|
5
|
+
## Development
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Start Vite development server
|
|
9
|
+
npm run dev
|
|
10
|
+
|
|
11
|
+
# Build production bundle to dist/
|
|
12
|
+
npm run build
|
|
13
|
+
|
|
14
|
+
# Preview built production bundle
|
|
15
|
+
npm run preview
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
- **Live Activity Feed**: Real-time SSE streaming of delivery statuses and handoffs.
|
|
21
|
+
- **Historical Audit Logs**: Queryable, paginated notification lifecycle trails and payload inspector.
|
|
22
|
+
- **System Health**: PostgreSQL and Redis latencies and worker heartbeat monitoring.
|
|
23
|
+
- **Analytics & Queues**: Real-time Redis Streams queue depth gauges and delivery SLA metrics.
|
|
24
|
+
- **Dead Letter Queue (DLQ)**: Poison message diagnostics with stream replay and purge capabilities.
|
|
25
|
+
- **Scheduled Pipeline**: Future dispatch scheduling and quiet hours deferrals.
|
|
26
|
+
- **Workflows**: Multi-step notification sequence diagrams and instance step execution tracing.
|
|
27
|
+
- **Templates**: Channel bindings, dynamic variables, and prompt previewing.
|
|
28
|
+
- **User Directory**: Contact channels and opt-out preferences.
|
|
29
|
+
- **Projects & API Keys**: Tenant workspace configuration and scoped token provisioning.
|