Skip to main content
OpenFeature is a CNCF-incubating open standard for feature flagging. GrowthBook provides OpenFeature provider SDKs for Python, Go, .NET, and Java — listed in the OpenFeature ecosystem.

Prerequisites

  • A GrowthBook account (cloud or self-hosted)
  • An SDK Connection key — create one under Settings → SDK Connections in the GrowthBook UI
  • The API host:
    • Cloud: https://cdn.growthbook.io
    • Self-hosted: your own GrowthBook URL (e.g. https://growthbook.example.com)

Why Use OpenFeature with GrowthBook?

OpenFeature defines a vendor-neutral interface for evaluating feature flags. Using a GrowthBook OpenFeature provider means:
  • Vendor portability — Your flag evaluation code is identical regardless of which provider is active. Switching from or to GrowthBook only requires changing the provider bootstrap, not a single flag call.
  • Standardized API — Teams use the same OpenFeature interface they already know across all services.
  • Ecosystem compatibility — OpenFeature-aware tooling — including OpenTelemetry hooks and other instrumentation — works automatically with GrowthBook.
  • Polyglot consistency — The same conceptual API spans Python, Go, .NET, Java (and more), giving teams a single mental model.
When to use the native GrowthBook SDK insteadThe native GrowthBook SDKs expose features that go beyond the OpenFeature interface: Sticky Bucketing, Visual Editor experiments, inline experiment definitions, and real-time SSE streaming. If you need those capabilities, use the native SDK for your language instead.

Installation & Setup

GitHub: growthbook-openfeature-provider-python  |  PyPI: growthbook-openfeature-providerRequirements: Python 3.9+
Async setup (recommended for async frameworks like FastAPI, aiohttp):
Synchronous setup:

Evaluation Context (Targeting Attributes)

Pass user attributes to the OpenFeature client via an EvaluationContext. These become GrowthBook targeting attributes used for percentage rollouts, feature targeting rules, and experiment bucketing. The targetingKey maps to the user ID in GrowthBook. Additional attributes (e.g. country, plan, email) are matched against your feature flag targeting conditions.

Evaluating Feature Flags

OpenFeature defines five value types. GrowthBook’s feature flags map to all of them.

Boolean

The most common type — use for on/off feature gates.

String

Use for multi-variant flags where the value is a string (e.g. button color, layout variant).

Integer & Float/Double

Use for numeric feature values such as rate limits, timeouts, or pricing.

Object

Use for structured feature values (e.g. configuration payloads, theme objects).

Configuration Options

Shutdown & Cleanup

Always shut down the provider when your application exits to close background connections.

Further Reading