SaaS Stack
← All updates

v2.2.0 — notifications, and PostHog beside Mixpanel

v2.2.0 brings two milestones from the roadmap: notifications, and PostHog. Nothing you built has to change.

Notifications

Every SaaS ends up telling people things: someone joined, an export is ready, the month’s allowance is used up. Push alone is not enough. Someone without the app never hears it, and nobody can find it again later.

  • One call from any module: notifications.notify(userId, { type, title, body }), or to a workspace’s owners and admins with notifyMembers().
  • Kept until they see it: under a bell in the web app and in a new Notifications tab on the phone, with unread counts, “mark all as read”, and a link to what each one is about.
  • On the phone or by email, as each person chooses: every kind has its defaults, and a settings page on the web and the phone to change them.
  • Live: a new one shows up at once, on every device, whichever copy of the API sent it. Read it on your laptop and the count drops on your phone.
  • Events for one person: realtime.publishToUser() reaches only that person’s open apps, for “look again” or “your export is ready”, and keeps nothing.

The kit sends three of its own: an invitation to someone who already has an account, someone joining a workspace, and a month’s allowance used up. The mobile app now keeps a realtime connection too, so usage and workspace changes appear there without a refresh.

See Notifications.

PostHog

Mixpanel stays the default. If you would rather keep analytics next to session replay and feature flags, or host it yourself, set one variable:

Terminal window
ANALYTICS_PROVIDER=posthog
POSTHOG_KEY=phc_...
POSTHOG_HOST=https://eu.i.posthog.com # or US, or your own
  • The same events, named once in the contracts and sent from the API, the web app and the mobile app. No feature changes.
  • Grouped by workspace with teams on, for group analytics, as with Mixpanel.
  • Private by default: no autocapture or session replay until you turn them on, and no query strings in any address it sends. The browser downloads PostHog only when it is set.

See Mixpanel or PostHog for which to pick.

Tested on every surface

Both land with tests on all three ORMs, browser journeys in both modes, and flows on iOS and Android: an invitation reaching the open Notifications tab live, and choosing where notifications go.

Upgrading

  1. Run bun install for PostHog’s libraries, then bun run db:migrate for the two new tables.
  2. If you send pushes with PushService.notify() for something people should find later too, send a notification instead.
  3. If a page of yours that a notification points to has a screen in the mobile app, add it to screenFor().

UPGRADING.md has the full list, and the upgrade-kit skill applies it on a branch.

Next

In-app purchases on iOS and Android through RevenueCat. The roadmap has the details.

Get the next one by email

Only project updates. Unsubscribe with one click.