Part 8 — Feature flags, rollout & analytics
The whole feature sits behind one scoped flag, so it can be turned on per org / community / user and rolled out gradually. Nothing in Notify-Me sends or serves data when the flag is off.
The flag
notify-me, resolved through the new @bewith-dev/feature-flags store, scoped by org / community / user:
- The digest checks the flag per community before selecting/sending (Part 4).
- The public See-all endpoint is org-gated — flag off ⇒ empty result (Part 6).
- The admin/resident surfaces are shown only when the flag is on for the viewer.
Rollout
Gradual: enable for a pilot org/community, widen by org, then general. Because the cron target list (Part 7) can be derived from the enabled set, enabling the flag is the onboarding action.
Open question / follow-up
The flag is resolved by string today. Registering notify-me as a typed FlagKey in the feature-flags package (codegen) is a follow-up, so authenticated endpoints can be gated declaratively via the @RequireFeatureFlag guard rather than an in-service resolve.
Analytics (later)
Sends by topic / channel / district, tagger coverage + confidence, and digest open/click. Not in the v1 scope; captured here so the events are instrumented consistently when added.
Acceptance criteria
- With the flag off for an org, no digest is sent and the See-all endpoint returns empty.
- Enabling the flag for a community includes it in the next digest run.