# better-push documentation

> Implementation and operations guidance for self-hosted push and in-app notifications in TypeScript applications.

- [Overview](/docs): Understand how better-push fits into your application and choose the right setup path.
- Start here
  - [Quickstart](/docs/quickstart): Add better-push to an existing Node and Postgres application and verify the first delivery.
  - [Emulator](/docs/emulator): See a notification without a device, a certificate, or a permission prompt.
  - [Demo matrix](/docs/demos): Five running frameworks, three interchangeable Postgres drivers, one session and one queue.
  - [Comparison](/docs/comparison): How a library inside your stack differs from a hosted notification service.
- Integrate your stack
  - Walkthroughs
    - [Framework walkthroughs](/docs/walkthroughs): Choose a server framework and build a working better-push integration.
    - [Next.js walkthrough](/docs/walkthroughs/nextjs): From nothing to a notification you can see, in five commands.
    - [TanStack Start walkthrough](/docs/walkthroughs/tanstack): See the TanStack Start plus Prisma demo running.
    - [Express walkthrough](/docs/walkthroughs/express): See the Express 5 plus raw pg demo running.
    - [Hono walkthrough](/docs/walkthroughs/hono): better-push on a Hono API, with the emulator standing in for a client.
    - [NestJS walkthrough](/docs/walkthroughs/nestjs): better-push on NestJS, including the basePath trap.
  - [Database adapters](/docs/database-adapters): One Postgres SQL core, three drivers - pg, Drizzle, and Prisma - and who owns the schema.
  - [Sessions](/docs/sessions): Wire better-push to your auth - better-auth, NextAuth, Clerk, or a custom JWT.
  - [TanStack Start](/docs/tanstack): Mount better-push in a TanStack Start app with a server route.
  - [Express](/docs/express): Mount better-push on Express, and the three things that decide whether it works.
  - [Hono](/docs/hono): Mount better-push on Hono - four lines, and nothing is adapted.
  - [NestJS](/docs/nestjs): Mount better-push as a Nest module, with forRoot and forRootAsync.
- Build notifications
  - [Typed notifications](/docs/typed-notifications): Declare notification types once with define() and get type-checked notify() calls.
  - [In-app feed](/docs/in-app-feed): A queryable, paginated in-app notification feed with unread counts and read state.
  - [Preferences](/docs/preferences): Per-type, per-channel notification preferences with deterministic resolution and suppression.
  - [UI components](/docs/ui-components): Styled components you copy into your project and own.
  - [Digests](/docs/digests): Collapse a burst of notifications into one, with a fixed window or a sliding debounce.
  - [Scheduled sends](/docs/scheduled-sends): Send this tomorrow at 9am - with an id you can cancel.
- Delivery channels
  - [Providers](/docs/providers): The provider model, routing by device.provider, and the web/Android/iOS matrix.
  - [Web Push setup](/docs/web-push-setup): VAPID keys, the service worker, and the HTTPS requirement explained.
  - [FCM setup](/docs/fcm-setup): Firebase project, service account, FCM for web, and Android device tokens.
  - [APNs setup](/docs/apns-setup): The p8 auth key, the topic, sandbox vs production, and direct HTTP/2 delivery.
  - [Expo push setup](/docs/expo-setup): Deliver through the Expo push service - tickets, receipts, and why receipts need a queue.
  - [Token lifecycle](/docs/token-lifecycle): Dead-token pruning, rotation by re-registration, and the opt-in staleDeviceAfter cutoff.
  - [Test Web Push on devices](/docs/testing-on-devices): Install the PWA and verify web push on real Android and iOS phones.
  - [React Native](/docs/react-native): Register device tokens, read the in-app feed, and edit preferences from an Expo app with @better-push/core/native.
  - [Test native mobile delivery](/docs/native-testing): Register APNs, FCM or Expo push tokens from an Expo dev client and verify delivery on real hardware.
- Operate in production
  - [Deployment](/docs/deployment): Which pieces to run where, per platform.
  - [Async delivery](/docs/async-delivery): Move sending off the request path with dbQueue() or bullmq() - the Postgres you already have, or the Redis you already have.
  - [Run a worker](/docs/running-a-worker): startWorker in a container, graceful shutdown, multiple workers, and the cron/serverless path.
  - [Retries and failures](/docs/retries-and-failures): Which provider errors are retried, how backoff works, and what dead-lettering leaves behind.
  - [Cache](/docs/cache): An optional cache that accelerates hot reads, shares rate limits, and carries realtime signals between instances.
  - [Realtime feed](/docs/realtime-feed): Server-sent events for the in-app feed - instant updates, with polling as the honest fallback.
  - [Rate limiting](/docs/rate-limiting): Per-user limits on the mounted router - on by default, shared through the cache, and failing open.
  - [Metrics, rollups, and retention](/docs/metrics-and-retention): Hourly rollups that keep charts cheap, opt-in pruning, worker heartbeats, and the onEvent hook.
  - [Studio](/docs/studio): Monitoring, forensics, and operator actions over the rows better-push already writes.
  - [Run Studio locally](/docs/studio-local): npx @better-push/cli studio - the studio against your own database, on localhost.
  - [Mount Studio in an application](/docs/studio-production): studioHandler, the permission model, server-side redaction, and the audit trail.
  - [Security](/docs/security): The boundaries better-push enforces, and the ones your application owns.
- Reference
  - [Configuration](/docs/configuration): Server options, defaults, and the public package entry points.
  - [CLI reference](/docs/cli): Scaffold, migrate, diagnose, emulate, and inspect a better-push installation.
  - [AI and agent access](/docs/agent-access): Read the better-push documentation as clean Markdown without parsing the website.