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
115 changes: 115 additions & 0 deletions docs/reference/sdks/client/dart.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
---
title: OpenFeature Dart SDK
sidebar_label: Dart
---

<!--
This content has been automatically generated from dart-sdk.

Edits should be made here: https://github.com/open-feature/dart-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Tue Sep 15 2026 14:25:44 GMT-0400 (Eastern Daylight Time)
-->

# OpenFeature Dart Client SDK
This package is the vendor-neutral OpenFeature SDK for Dart client
applications. It uses the static-context paradigm. It has no Flutter or
`dart:io` dependency.

The package is in beta. The first beta defines the public client and provider
contracts. It provides synchronous typed evaluation, event handlers, hooks,
ordered context changes, and an in-memory provider. Later beta changes will
complete the remaining conformance work before the first stable release.

## Install

The published beta requires Dart 3.12.2 or later within Dart 3.x. Flutter
applications need a Flutter release that includes a compatible Dart SDK.

```yaml
dependencies:
openfeature_dart_client_sdk: ^0.0.1-beta.1
```

Run `dart pub get`, or `flutter pub get` in a Flutter application.

## Use the client

```dart
import 'package:openfeature_dart_client_sdk/openfeature_dart_client_sdk.dart';

Future<void> main() async {
final provider = InMemoryProvider({
'new-checkout': true,
'welcome-message': 'Hello',
});

await OpenFeatureAPI.instance.setProviderAndWait(provider);
await OpenFeatureAPI.instance.setEvaluationContextAndWait(
EvaluationContext(targetingKey: 'user-123'),
);

final client = OpenFeatureAPI.instance.getClient('checkout');
final enabled = client.getBooleanValue('new-checkout', false);
final message = client.getStringValue('welcome-message', 'Welcome');

print('$enabled: $message');
await OpenFeatureAPI.instance.shutdown();
}
```

## Implement a provider

Implement `FeatureProvider` with synchronous resolvers. A resolver must use
local state. It must not perform network, file, or platform-channel I/O.

Implement only the optional capabilities that the provider needs:

- `InitializableProvider` for asynchronous initialization.
- `ContextReconciliationProvider` for static-context changes.
- `ShutdownProvider` for resource cleanup.
- `ProviderEventSource` for provider lifecycle events.
- `DomainScopedProvider` when one provider instance supports one domain.
- `TrackingProvider` for non-blocking tracking.

An initializable or reconciling provider must also implement
`ProviderEventSource`. It must emit the terminal lifecycle event before its
method terminates. The SDK bounds lifecycle waits to 30 seconds by default so
a provider contract violation cannot indefinitely block context changes or
shutdown. Tests and isolated integrations may select a shorter timeout through
`createIsolatedOpenFeatureAPI(lifecycleTimeout: ...)`.

When initialization or context reconciliation times out, the SDK quarantines
and detaches that provider instance. Its underlying asynchronous work cannot be
cancelled safely, so applications must register a new provider instance rather
than retrying the timed-out one. Subscription cancellation and shutdown cleanup
are bounded by the same timeout.

A provider that implements `ContextReconciliationProvider` can have only one
active API/domain binding. Use a separate provider instance for each static
context. Providers that resolve entirely from the context passed to each
resolver and do not reconcile cached state may be shared across domains.

The server and client packages share the
[`open-feature/dart-sdk`](https://github.com/open-feature/dart-sdk) repository.
The repository rename preserves this package name, Dart imports, and independent
client releases.

## Scope

This package does not include an HTTP transport, an OFREP provider, a vendor
provider, persistent storage, or Flutter APIs.

## Validate the package archive

Run the repository staging command to create and validate the same isolated
client archive used by the publication workflow:

```text
dart tool/stage_client_package.dart --dry-run
```

See the
[beta release procedure](https://github.com/open-feature/dart-sdk/blob/main/doc/client-sdk-release.md)
for the first-publication bootstrap and later automated prereleases.
62 changes: 38 additions & 24 deletions docs/reference/sdks/server/dart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ sidebar_label: Dart
---

<!--
This content has been automatically generated from dart-server-sdk.
This content has been automatically generated from dart-sdk.

Edits should be made here: https://github.com/open-feature/dart-server-sdk
Edits should be made here: https://github.com/open-feature/dart-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs

Last updated at Fri Aug 28 2026 12:00:12 GMT+0000 (Coordinated Universal Time)
Last updated at Tue Sep 15 2026 14:25:44 GMT-0400 (Eastern Daylight 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/dart-server-sdk/releases/tag/v0.0.23">
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.0.23&color=blue&style=for-the-badge" />
<a href="https://github.com/open-feature/dart-sdk/releases/tag/v0.0.24">
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.0.24&color=blue&style=for-the-badge" />
</a>

<a href="https://dart.dev/">
Expand All @@ -33,25 +33,39 @@ Last updated at Fri Aug 28 2026 12:00:12 GMT+0000 (Coordinated Universal Time)
<a href="https://openfeature.dev/docs/reference/intro">
<img alt="API Reference" src="https://img.shields.io/badge/API-reference-blue.svg?style=for-the-badge" />
</a>
<a href="https://codecov.io/gh/open-feature/dart-server-sdk">
<img alt="Code Coverage" src="https://codecov.io/gh/open-feature/dart-server-sdk/branch/main/graph/badge.svg?token=FZ17BHNSU5" />
<a href="https://codecov.io/gh/open-feature/dart-sdk">
<img alt="Code Coverage" src="https://codecov.io/gh/open-feature/dart-sdk/branch/main/graph/badge.svg?token=FZ17BHNSU5" />
</a>
<a href="https://github.com/open-feature/dart-server-sdk/actions/workflows/validation-workflow.yml">
<img alt="GitHub CI Status" src="https://github.com/open-feature/dart-server-sdk/actions/workflows/validation-workflow.yml/badge.svg?style=for-the-badge" />
<a href="https://github.com/open-feature/dart-sdk/actions/workflows/validation-workflow.yml">
<img alt="GitHub CI Status" src="https://github.com/open-feature/dart-sdk/actions/workflows/validation-workflow.yml/badge.svg?style=for-the-badge" />
</a>
</p>

## Dart client SDK proposal
## Repository source and client SDK beta

This repository also contains the design proposal for a separate, pure-Dart
OpenFeature client SDK intended for Dart VM, Dart web, and Flutter consumers.
The client SDK is not implemented or published yet. The existing server SDK
remains independently versioned and published.
This server package now lives at
`packages/openfeature_dart_server_sdk` in the source repository. Pub.dev
dependencies and `package:openfeature_dart_server_sdk/...` imports are
unchanged. Git dependencies that previously resolved the package from the
repository root must add:

- Read the [client SDK architecture](https://github.com/open-feature/dart-server-sdk/blob/main/doc/client-sdk-architecture.md).
```yaml
path: packages/openfeature_dart_server_sdk
```

The same repository also contains a separate pure-Dart client SDK beta for
Dart VM, Dart web, and Flutter consumers. The two packages remain independently
versioned and published.

- See the
[client package](https://github.com/open-feature/dart-sdk/tree/main/packages/openfeature_dart_client_sdk).
- Read the
[client SDK architecture](https://github.com/open-feature/dart-sdk/blob/main/doc/client-sdk-architecture.md).
- Review the
[client SDK conformance matrix](https://github.com/open-feature/dart-server-sdk/blob/main/doc/client-sdk-conformance-matrix.md).
- Follow [issue #117](https://github.com/open-feature/dart-server-sdk/issues/117)
[client SDK conformance matrix](https://github.com/open-feature/dart-sdk/blob/main/doc/client-sdk-conformance-matrix.md).
- Read the
[client beta release procedure](https://github.com/open-feature/dart-sdk/blob/main/doc/client-sdk-release.md).
- Follow [issue #117](https://github.com/open-feature/dart-sdk/issues/117)
for implementation progress.

## Quick start
Expand All @@ -68,7 +82,7 @@ Dart language version: [3.12.2](https://dart.dev/get-dart/archive)

```yaml
dependencies:
openfeature_dart_server_sdk: ^0.0.23
openfeature_dart_server_sdk: ^0.0.24
```

### Then run
Expand Down Expand Up @@ -142,9 +156,9 @@ for the complete API documentation.
### Providers

[Providers](/docs/reference/concepts/provider) are an
abstraction between a flag management system and the OpenFeature SDK. Look
[here](//ecosystem?instant_search%5BrefinementList%5D%5Btype%5D%5B0%5D=Provider&instant_search%5BrefinementList%5D%5BallTechnologies%5D%5B0%5D=Dart)
for a complete list of available providers. If the provider you need does not
abstraction between a flag management system and the OpenFeature SDK. See the
[available providers](//ecosystem?instant_search%5BrefinementList%5D%5Btype%5D%5B0%5D=Provider&instant_search%5BrefinementList%5D%5BallTechnologies%5D%5B0%5D=Dart)
for a complete list. If the provider you need does not
exist yet, see [Develop a provider](#develop-a-provider).

```dart
Expand Down Expand Up @@ -196,9 +210,9 @@ final result = await client.getBooleanFlag(
### Hooks

[Hooks](/docs/reference/concepts/hooks) allow custom
logic to be added at well-defined points of the flag evaluation life-cycle. Look
[here](/ecosystem/?instant_search%5BrefinementList%5D%5Btype%5D%5B0%5D=Hook&instant_search%5BrefinementList%5D%5Btechnology%5D%5B0%5D=Dart)
for a complete list of available hooks.
logic to be added at well-defined points of the flag evaluation life-cycle. See
the [available hooks](/ecosystem/?instant_search%5BrefinementList%5D%5Btype%5D%5B0%5D=Hook&instant_search%5BrefinementList%5D%5Btechnology%5D%5B0%5D=Dart)
for a complete list.

Once you have added a hook dependency, it can be registered at the global or
client level.
Expand Down
14 changes: 14 additions & 0 deletions src/datasets/sdks/dart-client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { SDK } from '.';

export const DartClient: SDK = {
name: 'Dart',
category: 'Client',
description: 'OpenFeature static-context Dart client SDK for Dart and Flutter applications (beta).',
repo: 'dart-sdk',
folder: '/packages/openfeature_dart_client_sdk',
logoKey: 'dart-no-fill.svg',
technology: 'Dart',
href: '/docs/reference/sdks/client/dart',
// The beta has not completed conformance; do not imply a stable support matrix.
includeInSupportMatrix: false,
};
3 changes: 2 additions & 1 deletion src/datasets/sdks/dart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { SDK } from '.';
export const Dart: SDK = {
name: 'Dart',
category: 'Server',
repo: 'dart-server-sdk',
repo: 'dart-sdk',
folder: '/packages/openfeature_dart_server_sdk',
logoKey: 'dart-no-fill.svg',
technology: 'Dart',
href: '/docs/reference/sdks/server/dart',
Expand Down
2 changes: 2 additions & 0 deletions src/datasets/sdks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { Cpp } from './cpp';
import { NextjsFlagsSDK } from './nextjs-flags-sdk';
import { SveltekitFlagsSDK } from './sveltekit-flags-sdk';
import { Dart } from './dart';
import { DartClient } from './dart-client';
export const SDKS = [
Java,
Nodejs,
Expand All @@ -32,6 +33,7 @@ export const SDKS = [
Ruby,
Angular,
Dart,
DartClient,
Rust,
Cpp,
NextjsFlagsSDK,
Expand Down
4 changes: 2 additions & 2 deletions src/datasets/sdks/sdk-compatibility.json
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,8 @@
"path": "/docs/reference/sdks/server/dart",
"category": "Server",
"release": {
"href": "https://github.com/open-feature/dart-server-sdk/releases/tag/v0.0.23",
"version": "0.0.23",
"href": "https://github.com/open-feature/dart-sdk/releases/tag/v0.0.24",
"version": "0.0.24",
"stable": false
},
"spec": {
Expand Down