Skip to content

Gates on OpenFeature

OpenFeature is the CNCF-standard feature-flag API: one vendor-neutral SDK your application code talks to, with the flag backend plugged in as a provider. Lucerna ships official providers, so Gates works anywhere OpenFeature does — your code imports the standard SDK, never a Lucerna package.

Why we adhere to it

  • No lock-in, in either direction. Your flag checks are written against @openfeature/*, not against us. Adopting Gates in an app that already uses OpenFeature is a one-line provider swap — and so is leaving, which is exactly the deal a flag vendor should offer.
  • The ecosystem comes free. Anything built on OpenFeature works with Gates through the provider: Vercel's Flags SDK for Next.js and SvelteKit, the NestJS integration with its decorators and route guards, OpenTelemetry hooks, and whatever the ecosystem adds next.
  • The semantics survive the abstraction. Kill switches, sticky experiment bucketing, and server-side exposure recording all map cleanly onto OpenFeature's evaluation model — see the table below. You give up no Gates behavior by going through the standard API.

If you're not already invested in OpenFeature, the native SDKs (Node, Browser) are the more direct path — smaller API, same engine.

How Gates maps

OpenFeature reads are typed; Gates answers two of the types and refuses the rest loudly:

OpenFeature readGates conceptBehavior
getBooleanValueFeature flagKill switches folded in — a thrown switch reads false
getStringValueExperimentThe assigned variant name; exposure is recorded on the read
getNumberValue / getObjectValueYour default with TYPE_MISMATCH; Gates has no such flags

Identity rides in the standard evaluation context: targetingKey becomes the Gates userId (the sticky-bucketing unit), every other primitive attribute becomes a trait your targeting rules match on.

ts
const context = { targetingKey: user.id, plan: user.plan };
await client.getBooleanValue("new_billing", false, context);

Reads never throw. Failures resolve the safe Gates default — false for flags, your default for variants — and surface through the provider's onError tap.

Choose your integration

You're buildingUseProvider package
A Node backend (Express, Fastify, workers, serverless)Node quickstart@lucerna-dev/gates-openfeature
A NestJS appNestJS guide@lucerna-dev/gates-openfeature
A Next.js or SvelteKit app on Vercel's Flags SDKVercel Flags SDK guide@lucerna-dev/gates-openfeature
A React SPAReact guide@lucerna-dev/gates-openfeature-web

Not on OpenFeature?

The Browser SDK's native React bindings offer the same decisions engine with a smaller, Gates-native API — hooks and declarative components without the OpenFeature layer.

Next

  • Node quickstart — provider registered and first flag read in under a minute.
  • React guide — flags and experiments in a React SPA, synchronously.
  • Reference — options, context mapping, failure semantics, caching.
  • Vercel Flags SDK — Gates inside flag() declarations.

Lucerna Developer Docs