Skip to content

Notifications · Reference

Notification Persistence

A legacy source-install option for app-owned PostgreSQL notification tables and codecs; new apps should use @krak-stack/notifications.

Last updated October 8, 2026

Legacy Source-Install Option

notification-persistence vendors three project-owned PostgreSQL tables into an application: notifications, notification_settings, and notification_deliveries. It also vendors Effect record schemas and versioned payload codecs. It remains available for projects that intentionally own their Drizzle schema and worker implementation.

New durable notification systems should install @krak-stack/notifications instead. The package owns migrations, inbox CRUD, preference and suppression CRUD, delivery attempts and references, Effect persisted-queue jobs, the scheduler and workers, and one-shot reminders.

Install

shell
bunx shadcn@latest add @krak-stack/notification-persistence

Included Files

  • services/notification/persistence/drizzle.ts - Legacy Drizzle tables, indexes, constraints, and inferred row types
  • services/notification/persistence/schema.ts - Legacy record schemas, lifecycle values, and payload codecs
  • services/notification/persistence/index.ts - Server-only compatibility exports

Existing Applications

Re-export the installed definitions from the app's Drizzle schema only while the application remains the migration owner:

ts
export * from "@/services/notification/persistence/drizzle";

This item provides no authorization queries, CRUD service, migrations, relay, scheduler, retry runtime, or worker. The application must implement and operate all of those concerns.

Adopt @krak-stack/notifications

Preserve the three existing tables and stop every application-owned relay and worker before cutover. The package's additive migration adopts their data, reconciles legacy processing rows, and imports disabled rows from a compatible email_preferences table. Move application correlations to notification_delivery_references, then exclude all package-owned notification and queue tables from application Drizzle migrations. See the Notifications guide for the complete cutover sequence.

Dependencies
Packages and shadcn components required by this registry item.