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
24 changes: 23 additions & 1 deletion product-handbook/multivariate-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,28 @@ export function AssistantSettings() {

The second argument supplies a default while flags load or if the flag is unavailable. In this example, the default is the `quick` model with a 512-token limit and citations turned off. Pass a default when reading a Multivariate flag; without one, `useFlag()` expects a Boolean value.

## Supported SDKs

Multivariate flags need one of these SDK versions:

| SDK | Package | Supported from |
| ----------------------------------------------------------------- | -------------------------------------- | -------------- |
| [React](../supported-languages/react-sdk/README.md) | `@reflag/react-sdk` | 2.0.0 |
| [React Native](../supported-languages/react-native-sdk/README.md) | `@reflag/react-native-sdk` | 2.0.0 |
| [Vue](../supported-languages/vue-sdk/README.md) | `@reflag/vue-sdk` | 2.0.0 |
| [Browser](../supported-languages/browser-sdk/README.md) | `@reflag/browser-sdk` | 2.0.0 |
| [Node.js](../supported-languages/node-sdk/README.md) | `@reflag/node-sdk` | 2.0.0 |
| [Python](../supported-languages/python-sdk.md) | `reflag` | 0.1.0 |
| [.NET](../supported-languages/dotnet-sdk.md) | `Reflag.RuntimeSDK` | 0.3.0 |
| [OpenFeature](../supported-languages/openfeature.md) (Node.js) | `@reflag/openfeature-node-provider` | 2.0.0 |
| [OpenFeature](../supported-languages/openfeature.md) (Browser) | `@reflag/openfeature-browser-provider` | 2.0.0 |

[Next.js](../supported-languages/next.js.md) apps use the React and Node.js SDKs, so they need v2 of both. To generate types for Multivariate flags, use [CLI](../api/cli.md) v2.

{% hint style="warning" %}
**SDK v1 doesn't support Multivariate flags.** v1 clients don't receive them. Older app versions, installed mobile builds and already-open browser tabs keep running v1 until they update. To upgrade, see [Migrating from v1](../supported-languages/migrating-from-v1.md).
{% endhint %}

## Variants and values

For each environment, configure:
Expand Down Expand Up @@ -93,7 +115,7 @@ If access and configuration are separate decisions, use a Boolean flag such as `
1. Create a **Multivariate** flag.
2. Open its **Variants** tab and configure variants, specific targets, rules, and the default for the selected environment.
3. Save, then configure and verify any other environments separately.
4. Read the value with a [Reflag SDK](../supported-languages/overview.md), passing a default.
4. Read the value with a [supported SDK](#supported-sdks), passing a default.

## Migrating from Remote config

Expand Down
5 changes: 5 additions & 0 deletions supported-languages/migrating-from-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Version 2 of the Browser, React, React Native, Vue and Node.js SDKs changes how

- **Flags return their value directly.** `useFlag("new-editor")` returns `true` or `false` instead of `{ isEnabled }`.
- **Move legacy Remote config to a new Multivariate flag.** Existing configs aren't converted automatically; read the new flag's value instead of `.config.payload`.
- **Multivariate flags need v2.** v1 clients don't receive them. See [which SDKs support Multivariate flags](../product-handbook/multivariate-flags.md#supported-sdks).
- **Tracking and feedback are separate.** They have their own hooks and client methods instead of being returned with a flag.
- **React's `useFlag()` no longer suspends.** Use `useFlagSuspense()` when you want Suspense.
- **The `fallbackFlags` option is removed.** Pass a default to each flag read instead.
Expand Down Expand Up @@ -107,6 +108,10 @@ const { maxItems } = useFlag("editor-config", { maxItems: 10 });

Existing remote config is **not converted automatically**. If a v1 flag controlled both access and configuration, keep the existing Boolean flag for access and use the new Multivariate flag for settings. Follow the [Remote config migration steps](../product-handbook/multivariate-flags.md#migrating-from-remote-config).

{% hint style="warning" %}
Clients still on v1 don't receive the new Multivariate flag, so they keep reading the legacy Remote config. Leave it in place until no supported clients use v1. Python, .NET and OpenFeature also support Multivariate flags; check the [minimum versions](../product-handbook/multivariate-flags.md#supported-sdks).
{% endhint %}

## 3. Separate usage tracking and feedback

React and Vue use their dedicated hooks/composables rather than methods returned by `useFlag()`:
Expand Down
Loading