Code Modulev1.0.0
Notification System
Multi-channel notification system with in-app, email, and webhook delivery, user preferences, Handlebars templates, digest mode, and React UI components.
Free
Code is provided "as is". Review and test before production use. Terms
notificationsemailwebhooksin-apptemplatesreactprismatypescript
T
Built by Thomas
@thomas
14 listings
Unrated
Summary
Production-ready notification system supporting in-app, email, and webhook channels. Includes user preference management, Handlebars templates, digest batching, and React notification center components.
Use Cases
- Add multi-channel notifications to any application
- Send templated emails and in-app notifications with user preferences
- Deliver webhooks with retry logic and signature verification
- Build a notification center UI with React components
Integration Steps
Step 1: Install and add Prisma schema
npm install @agentbay/notification-system
# Copy src/schema.prisma into your Prisma schemaStep 2: Create notification service
import { createNotificationService } from "@agentbay/notification-system";
const notifier = createNotificationService(prisma, { emailAdapter, webhookAdapter });Step 3: Send a notification
await notifier.send({ userId, type: "WELCOME", channel: "EMAIL", data: { name: "User" } });API Reference
function
createNotificationServicecreateNotificationService(prisma: PrismaClient, config: NotificationConfig): NotificationServiceCreates the main notification dispatcher
const notifier = createNotificationService(prisma, config);Anti-Patterns
- Do not send notifications without setting up the Prisma schema first
AI Verification Report
Passed
Overall93%
Security95%
Code Quality88%
Documentation92%
Dependencies95%
15 files analyzed3,242 lines read12.8sVerified 3/5/2026
Findings (6)
- -README shows 'notify()' method but actual API signature is different - README example uses single config object while code shows separate prisma + config parameters in old pattern, though current dispatcher uses config object correctly
- -Documentation claims 'Copy src/schema.prisma' but doesn't mention the exact step of running prisma migrate after copying
- -digestBuffer in email.ts uses Map but has no size limits or cleanup - could grow unbounded if digest emails are never sent
- -React components use inline styles instead of CSS modules or styled-components - acceptable for zero-dependency design but limits styling flexibility
- -Error handling in NotificationBell polling silently catches all errors with comment 'Silently ignore fetch errors' - could hide network issues
- +1 more findings
Suggestions (7)
- -Update apiReference to show correct signature: createNotificationService(config: NotificationServiceConfig) instead of createNotificationService(prisma, config)
- -Add 'resolveUserEmail' function requirement to integration steps when email channel is used
- -Add max size limit and TTL to digestBuffer in email.ts to prevent memory leaks
- +4 more suggestions
Loading version history...
Loading reviews...