Skip to content

OpenFeature SDK

Evaluate Flagship feature flags from any JavaScript runtime using OpenFeature.

OpenFeature is the CNCF standard for feature flag interfaces. It provides a vendor-neutral API so you can switch between flag providers without changing evaluation code.

The @cloudflare/flagship package is an OpenFeature-compatible SDK for evaluating Flagship feature flags. The source code is available on GitHub.

The SDK includes two providers:

  • FlagshipServerProvider — For server-side runtimes such as Cloudflare Workers, Node.js, and other server-side JavaScript environments. Each evaluation call makes an asynchronous request to the Flagship evaluation endpoint.
  • FlagshipClientProvider — For browser applications. Pre-fetches all flag values on initialization and evaluates synchronously from an in-memory cache.

Installation

For server-side usage:

npm i @cloudflare/flagship @openfeature/server-sdk

For browser usage:

npm i @cloudflare/flagship @openfeature/web-sdk

Next steps