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)
- Cloud:
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.
Installation & Setup
- Python
- Go
- .NET
- Java
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 anEvaluationContext. 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
- OpenFeature specification — the full standard
- GrowthBook on the OpenFeature ecosystem
- Native GrowthBook SDKs — for Sticky Bucketing, Visual Editor, SSE streaming, and more

