provider Experiments GET
/api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey} @utdk/launchdarkly
/api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey} Get experiment
Get details about an experiment.
### Expanding the experiment response
LaunchDarkly supports five fields for expanding the "Get experiment" response. By default, these fields are **not** included in the response.
To expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:
- `previousIterations` includes all iterations prior to the current iteration. By default only the current iteration is included in the response.
- `draftIteration` includes the iteration which has not been started yet, if any.
- `secondaryMetrics` includes secondary metrics. By default only the primary metric is included in the response.
- `treatments` includes all treatment and parameter details. By default treatment data is not included in the response.
- `analysisConfig` includes the analysis configuration for the experiment, such as the Bayesian threshold or significance threshold.
For example, `expand=draftIteration,treatments` includes the `draftIteration` and `treatments` fields in the response. If fields that you request with the `expand` query parameter are empty, they are not included in the response.
- projectKey path required
- The project key
- string
- environmentKey path required
- The environment key
- string
- experimentKey path required
- The experiment key
- string
- expand query
- A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.
- 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.
Code snippet
Updates live as you fill in the form above.
TypeScript
import launchdarkly from '@utdk/launchdarkly';
await launchdarkly.getexperiment()