Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reference/sdks/client/kotlin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This content has been automatically generated from kotlin-sdk.
Edits should be made here: https://github.com/open-feature/kotlin-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Mon Jun 08 2026 09:46:34 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 01 2026 09:19:01 GMT+0000 (Coordinated Universal Time)
-->
import MCPInstall from '@site/src/partials/mcp-install';

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sdks/client/swift.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This content has been automatically generated from swift-sdk.
Edits should be made here: https://github.com/open-feature/swift-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Mon Jun 08 2026 09:46:35 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 01 2026 09:19:01 GMT+0000 (Coordinated Universal Time)
-->
import MCPInstall from '@site/src/partials/mcp-install';

Expand Down
83 changes: 56 additions & 27 deletions docs/reference/sdks/client/web/angular.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ This content has been automatically generated from js-sdk.
Edits should be made here: https://github.com/open-feature/js-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Mon Jun 08 2026 09:46:35 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 01 2026 09:19:01 GMT+0000 (Coordinated Universal Time)
-->

<p align="center" class="github-badges">
<a href="https://github.com/open-feature/spec/releases/tag/v0.8.0">
<img alt="Specification" src="https://img.shields.io/static/v1?label=specification&message=v0.8.0&color=yellow&style=for-the-badge" />
</a>

<a href="https://github.com/open-feature/js-sdk/releases/tag/angular-sdk-v1.2.0">
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.2.0&color=blue&style=for-the-badge" />
<a href="https://github.com/open-feature/js-sdk/releases/tag/angular-sdk-v1.3.1">
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.3.1&color=blue&style=for-the-badge" />
</a>

<br/>
Expand All @@ -46,8 +46,8 @@ In addition to the features provided by the [web sdk](/docs/reference/sdks/clien
- [yarn](#yarn)
- [Required peer dependencies](#required-peer-dependencies)
- [Usage](#usage)
- [Module](#module)
- [Minimal Example](#minimal-example)
- [Standalone configuration (recommended)](#standalone-configuration-recommended)
- [NgModule configuration (deprecated)](#ngmodule-configuration-deprecated)
- [How to use](#how-to-use)
- [Structural Directives](#structural-directives)
- [Boolean Feature Flag](#boolean-feature-flag)
Expand Down Expand Up @@ -100,9 +100,44 @@ See the [package.json](https://github.com/open-feature/js-sdk/blob/main/packages

### Usage

#### Module
#### Standalone configuration (recommended)

To configure OpenFeature for your application, import the `OpenFeatureModule` and call `forRoot` to register the provider(s) and optional evaluation context.
For standalone / `bootstrapApplication`-based apps, pass `provideOpenFeature()` in the `providers` array of your `ApplicationConfig`:

```typescript
import { ApplicationConfig } from '@angular/core';
import { provideOpenFeature } from '@openfeature/angular-sdk';

export const appConfig: ApplicationConfig = {
providers: [
provideOpenFeature({
provider: yourFeatureProvider,
// domainBoundProviders are optional, mostly needed if more than one provider is used in the application.
domainBoundProviders: {
domain1: new YourOpenFeatureProvider(),
domain2: new YourOtherOpenFeatureProvider(),
},
}),
],
};
```

Then bootstrap your app with this config:

```typescript
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app/app.component';
import { appConfig } from './app/app.config';

bootstrapApplication(AppComponent, appConfig);
```

#### NgModule configuration (deprecated)

> [!WARNING]
> `OpenFeatureModule` and `forRoot()` are deprecated. Use [`provideOpenFeature()`](#standalone-configuration-recommended) instead.

To configure OpenFeature for NgModule-based applications, import the `OpenFeatureModule` and call `forRoot` to register the provider(s) and optional evaluation context.

```typescript
import { NgModule } from '@angular/core';
Expand Down Expand Up @@ -358,20 +393,19 @@ const flag$ = this.flagService.getBooleanDetails('my-flag', false, 'my-domain',

##### Setting evaluation context

To set the initial evaluation context, you can add the `context` parameter to the `OpenFeatureModule` configuration.
To set the initial evaluation context, you can add the `context` parameter to the `provideOpenFeature()` configuration.
This context can be either an object or a factory function that returns an `EvaluationContext`.

> [!TIP]
> Updating the context can be done directly via the global OpenFeature API using `OpenFeature.setContext()`

Heres how you can define and use the initial client evaluation context:
Here's how you can define and use the initial client evaluation context:

###### Using a static object

```typescript
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { OpenFeatureModule } from '@openfeature/angular-sdk';
import { ApplicationConfig } from '@angular/core';
import { provideOpenFeature } from '@openfeature/angular-sdk';

const initialContext = {
user: {
Expand All @@ -380,37 +414,32 @@ const initialContext = {
},
};

@NgModule({
imports: [
CommonModule,
OpenFeatureModule.forRoot({
export const appConfig: ApplicationConfig = {
providers: [
provideOpenFeature({
provider: yourFeatureProvider,
context: initialContext,
}),
],
})
export class AppModule {}
};
```

###### Using a factory function

```typescript
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { OpenFeatureModule, EvaluationContext } from '@openfeature/angular-sdk';
import { ApplicationConfig } from '@angular/core';
import { provideOpenFeature, EvaluationContext } from '@openfeature/angular-sdk';

const contextFactory = (): EvaluationContext => loadContextFromLocalStorage();

@NgModule({
imports: [
CommonModule,
OpenFeatureModule.forRoot({
export const appConfig: ApplicationConfig = {
providers: [
provideOpenFeature({
provider: yourFeatureProvider,
context: contextFactory,
}),
],
})
export class AppModule {}
};
```

##### Observability considerations
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/sdks/client/web/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
Edits should be made here: https://github.com/open-feature/js-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Mon Jun 08 2026 09:46:34 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 01 2026 09:19:00 GMT+0000 (Coordinated Universal Time)
-->
import MCPInstall from '@site/src/partials/mcp-install';

Expand All @@ -20,8 +20,8 @@ import MCPInstall from '@site/src/partials/mcp-install';
<img alt="Specification" src="https://img.shields.io/static/v1?label=specification&message=v0.8.0&color=yellow&style=for-the-badge" />
</a>

<a href="https://github.com/open-feature/js-sdk/releases/tag/web-sdk-v1.8.0">
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.8.0&color=blue&style=for-the-badge" />
<a href="https://github.com/open-feature/js-sdk/releases/tag/web-sdk-v1.9.0">
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.9.0&color=blue&style=for-the-badge" />
</a>

<br/>
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/sdks/client/web/react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
Edits should be made here: https://github.com/open-feature/js-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Mon Jun 08 2026 09:46:34 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 01 2026 09:19:01 GMT+0000 (Coordinated Universal Time)
-->
import MCPInstall from '@site/src/partials/mcp-install';

Expand All @@ -20,8 +20,8 @@ import MCPInstall from '@site/src/partials/mcp-install';
<img alt="Specification" src="https://img.shields.io/static/v1?label=specification&message=v0.8.0&color=yellow&style=for-the-badge" />
</a>

<a href="https://github.com/open-feature/js-sdk/releases/tag/react-sdk-v1.3.0">
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.3.0&color=blue&style=for-the-badge" />
<a href="https://github.com/open-feature/js-sdk/releases/tag/react-sdk-v1.4.1">
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.4.1&color=blue&style=for-the-badge" />
</a>

<br/>
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sdks/server/cpp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This content has been automatically generated from cpp-sdk.
Edits should be made here: https://github.com/open-feature/cpp-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Mon Jun 08 2026 09:46:36 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 01 2026 09:19:02 GMT+0000 (Coordinated Universal Time)
-->

<p align="center" class="github-badges">
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sdks/server/dart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This content has been automatically generated from dart-server-sdk.
Edits should be made here: https://github.com/open-feature/dart-server-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Mon Jun 08 2026 09:46:35 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 01 2026 09:19:01 GMT+0000 (Coordinated Universal Time)
-->

<p align="center" class="github-badges">
Expand Down
13 changes: 10 additions & 3 deletions docs/reference/sdks/server/dotnet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ This content has been automatically generated from dotnet-sdk.
Edits should be made here: https://github.com/open-feature/dotnet-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Mon Jun 08 2026 09:46:33 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 01 2026 09:19:00 GMT+0000 (Coordinated Universal Time)
-->
import MCPInstall from '@site/src/partials/mcp-install';


[![Specification](https://img.shields.io/static/v1?label=specification&message=v0.8.0&color=yellow&style=for-the-badge)](https://github.com/open-feature/spec/releases/tag/v0.8.0)
[
![Release](https://img.shields.io/static/v1?label=release&message=v2.13.0&color=blue&style=for-the-badge)
](https://github.com/open-feature/dotnet-sdk/releases/tag/v2.13.0)
![Release](https://img.shields.io/static/v1?label=release&message=v2.14.0&color=blue&style=for-the-badge)
](https://github.com/open-feature/dotnet-sdk/releases/tag/v2.14.0)

[![Slack](https://img.shields.io/badge/slack-%40cncf%2Fopenfeature-brightgreen?style=flat&logo=slack)](https://cloud-native.slack.com/archives/C0344AANLA1)
[![Codecov](https://codecov.io/gh/open-feature/dotnet-sdk/branch/main/graph/badge.svg?token=MONAVJBXUJ)](https://codecov.io/gh/open-feature/dotnet-sdk)
Expand Down Expand Up @@ -643,6 +643,9 @@ services.AddOpenFeature(builder =>

### Trace Enricher Hook

> [!WARNING]
> As of v2.14, the OpenFeature SDK emits native OpenTelemetry spans for every flag evaluation without requiring any hooks. Use `TraceEnricherHook` when you want activities/spans **outside** of OpenFeature to be enriched with flag evaluation data. If you are already using `TraceEnricherHook`, you may see **new spans** appear in your observability platform after upgrading to v2.14.

The `TraceEnricherHook` enriches telemetry traces with additional information during the feature flag evaluation lifecycle. This hook adds relevant flag evaluation details as tags and events to the current `Activity` for tracing purposes.

For this hook to function correctly, an active span must be set in the current `Activity`, otherwise the hook will no-op.
Expand All @@ -662,6 +665,9 @@ Below are the tags added to the trace event:
| error.type | Describes a class of error the operation ended with | Evaluation details (if error) |
| error.message | A message explaining the nature of an error occurring during flag evaluation | Evaluation details (if error) |

> [!NOTE]
> To receive OpenTelemetry traces emitted natively by the OpenFeature SDK, add `.AddSource("OpenFeature")` to your `TracerProviderBuilder`. No hooks are required.

#### Example

The following example demonstrates the use of the `TraceEnricherHook` with the `OpenFeature dotnet-sdk`. The traces are sent to a `jaeger` OTLP collector running at `localhost:4317`.
Expand All @@ -682,6 +688,7 @@ namespace OpenFeatureTestApp

// set up the OpenTelemetry OTLP exporter
var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddSource("OpenFeature") // receive traces from OpenFeature SDK
.AddSource("my-tracer")
.ConfigureResource(r => r.AddService("jaeger-test"))
.AddOtlpExporter(o =>
Expand Down
16 changes: 8 additions & 8 deletions docs/reference/sdks/server/go.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This content has been automatically generated from go-sdk.
Edits should be made here: https://github.com/open-feature/go-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Mon Jun 08 2026 09:46:33 GMT+0000 (Coordinated Universal Time)
Last updated at Wed Jul 01 2026 09:19:00 GMT+0000 (Coordinated Universal Time)
-->
import MCPInstall from '@site/src/partials/mcp-install';

Expand Down Expand Up @@ -71,7 +71,7 @@ func main() {
// Register your feature flag provider
openfeature.SetProviderAndWait(openfeature.NoopProvider{})
// Create a new client
client := openfeature.NewClient("app")
client := openfeature.NewDefaultClient()
// Evaluate your feature flag
v2Enabled := client.Boolean(
context.TODO(), "v2_enabled", true, openfeature.EvaluationContext{},
Expand Down Expand Up @@ -137,7 +137,7 @@ openfeature.SetEvaluationContext(openfeature.NewTargetlessEvaluationContext(
))

// set a value to the client context
client := openfeature.NewClient("my-app")
client := openfeature.NewDefaultClient()
client.SetEvaluationContext(openfeature.NewTargetlessEvaluationContext(
map[string]any{
"version": "1.4.6",
Expand All @@ -151,7 +151,7 @@ evalCtx := openfeature.NewEvaluationContext(
"company": "Initech",
},
)
boolValue, err := client.BooleanValue(context.TODO(), "boolFlag", false, evalCtx)
boolValue := client.Boolean(context.TODO(), "boolFlag", false, evalCtx)
```

### Hooks
Expand All @@ -167,11 +167,11 @@ Once you've added a hook as a dependency, it can be registered at the global, cl
openfeature.AddHooks(ExampleGlobalHook{})

// add a hook on this client, to run on all evaluations made by this client
client := openfeature.NewClient("my-app")
client := openfeature.NewDefaultClient()
client.AddHooks(ExampleClientHook{})

// add a hook for this evaluation only
value, err := client.BooleanValue(
value := client.Boolean(
context.TODO(), "boolFlag", false, openfeature.EvaluationContext{}, openfeature.WithHooks(ExampleInvocationHook{}),
)
```
Expand All @@ -184,7 +184,7 @@ For example, a flag enhancing the appearance of a UI component might drive user

```go
// initialize a client
client := openfeature.NewClient("my-app")
client := openfeature.NewDefaultClient()

// trigger tracking event action
client.Track(
Expand Down Expand Up @@ -332,7 +332,7 @@ ec := openfeature.TransactionContext(ctx)
tCtx := openfeature.MergeTransactionContext(ctx, openfeature.EvaluationContext{})

// use TransactionContext in a flag evaluation
client.BooleanValue(tCtx, ....)
_ = client.Boolean(tCtx, ....)
```

### Multi-Provider Implementation
Expand Down
Loading
Loading