Skip to content
Open
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 Fri Jun 12 2026 09:35:00 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 Fri Jun 12 2026 09:35: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 Fri Jun 12 2026 09:35: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.0">
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.3.0&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
2 changes: 1 addition & 1 deletion 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 Fri Jun 12 2026 09:35:00 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/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 Fri Jun 12 2026 09:35:00 GMT+0000 (Coordinated Universal Time)
-->
import MCPInstall from '@site/src/partials/mcp-install';

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 Fri Jun 12 2026 09:35:01 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 Fri Jun 12 2026 09:35:01 GMT+0000 (Coordinated Universal Time)
-->

<p align="center" class="github-badges">
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sdks/server/dotnet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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 Fri Jun 12 2026 09:35:00 GMT+0000 (Coordinated Universal Time)
-->
import MCPInstall from '@site/src/partials/mcp-install';

Expand Down
2 changes: 1 addition & 1 deletion 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 Fri Jun 12 2026 09:35:00 GMT+0000 (Coordinated Universal Time)
-->
import MCPInstall from '@site/src/partials/mcp-install';

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sdks/server/java.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This content has been automatically generated from java-sdk.
Edits should be made here: https://github.com/open-feature/java-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 Fri Jun 12 2026 09:34:59 GMT+0000 (Coordinated Universal Time)
-->
import MCPInstall from '@site/src/partials/mcp-install';

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sdks/server/javascript/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:33 GMT+0000 (Coordinated Universal Time)
Last updated at Fri Jun 12 2026 09:34:59 GMT+0000 (Coordinated Universal Time)
-->
import MCPInstall from '@site/src/partials/mcp-install';

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sdks/server/javascript/nestjs.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:33 GMT+0000 (Coordinated Universal Time)
Last updated at Fri Jun 12 2026 09:35:00 GMT+0000 (Coordinated Universal Time)
-->
import MCPInstall from '@site/src/partials/mcp-install';

Expand Down
Loading
Loading