Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Frontend Feature Flags: 3 Backend API Checks Before Gradual Environment Rollout

Use frontend feature flags that poll a backend API for a healthtech tenant experiment, with rollback enforced again before any message is sent. The deciding constraint is that hiding a beta control cannot recall an OTP or appointment reminder already handed to a delivery provider. Short answer: A React or Next.js frontend can fetch safe feature flag values from a backend API on app load, then…

When implementing a healthtech tenant experiment using frontend feature flags, several backend API checks should be performed before executing a gradual rollout. Firstly, tenant identity must be obtained from server context, ensuring that a browser-provided tenant identifier cannot select another tenant's configuration. Environment and cohort membership must be explicitly provided to the server, distinguishing production from test traffic.

Before dispatching any new experimental sends, permission must be granted at the point of dispatch, including queued work created before the rollback.

Rollback should prohibit future dispatch admissions but not undo external side effects that have already occurred. The handoff boundary should be clearly recorded, with the dispatch decision requiring a defined ordering relative to the disable operation. If an operator disables the experiment while a worker is preparing a message, the dispatch decision should be made after the disable operation to avoid concurrency issues.

The frontend should fetch configuration at startup, periodically refresh it, and hide the experimental control when its local snapshot expires. On tenant switch, the previous tenant's state should be discarded before fetching the new one. Background tabs, network delays, and disconnected clients can extend the polling interval, which is a chosen setting rather than a delivery guarantee. A separate freshness limit should be defined for the UI and an independent dispatch rule for the server.

In the Node.js backend serving a React or Next.js application, the projection should be kept in the authenticated backend layer, as illustrated by a Python policy. The browser payload should be small, containing only an allowlisted boolean for displaying the beta flow. Patient identifiers, destination phone numbers, provider credentials, and cohort targeting rules should not be part of the payload. Regional cohort labels are experiment attributes and do not establish data residency or compliance certification.

Comparing different frontend feature flag services, LaunchDarkly, Unleash, and Flagsmith have their own strengths and weaknesses. While LaunchDarkly offers dedicated feature management, it may not provide the required dispatch authorization and tenant boundary evaluation. Unleash and Flagsmith, on the other hand, offer dedicated feature management services, but their documented deployment and rollout options need to be evaluated against the tenant boundary.

Ultimately, the application should own the release control, making irreversible sends authorized through an application gate. This approach ensures that the experiment behaves as expected, regardless of the frontend feature flag service used.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

More from Dev.to on urgent.news

Get the news by email. Yesterday's most-covered stories, every morning.

See today's edition · More options

More in Tech

CodeNexus: Building a Developer Community Platform

CodeNexus is a community hub for developers, built to run mentorship, event discovery and member onboarding from one lightweight site. I led the project. This is how it is put together and why.

  • CodeNexus is a developer community platform focusing on mentorship, events, and onboarding.
  • Built with vanilla HTML, CSS, and JavaScript for minimal overhead and fast performance.
  • Features GSoC Preparation Program with SSO, CSV/JSON exports, and mobile-first UI.

More from Saturday, 5 December 2026 →