provider User settings PUT /api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags/{featureFlagKey}
@utdk/launchdarkly /api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags/{featureFlagKey}
Update flag settings for user
Enable or disable a feature flag for a user based on their key. Omitting the `setting` attribute from the request body, or including a `setting` of `null`, erases the current setting for a user. If you previously patched the flag, and the patch included the user's data, LaunchDarkly continues to use that data. If LaunchDarkly has never encountered the user's key before, it calculates the flag values based on the user key alone.
projectKey path required
The project key
string
environmentKey path required
The environment key
string
userKey path required
The user key
string
featureFlagKey path required
The feature flag key
string

Try it

Authentication
Configure credentials for LaunchDarkly REST API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

putflagsetting
PUT/api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags/{featureFlagKey}
Enable or disable a feature flag for a user based on their key. Omitting the `setting` attribute from the request body, or including a `setting` of `null`, erases the current setting for a user. If you previously patched the flag, and the patch included the user's data, LaunchDarkly continues to use that data. If LaunchDarkly has never encountered the user's key before, it calculates the flag values based on the user key alone.

Parameters

required

The project key

required

The environment key

required

The user key

required

The feature flag key

Input

The variation value to set for the context. Must match the flag's variation type.

Optional comment describing the change

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import launchdarkly from '@utdk/launchdarkly';

await launchdarkly.putflagsetting()