provider Experiments POST
/api/v2/projects/{projectKey}/environments/{environmentKey}/experiments @utdk/launchdarkly
/api/v2/projects/{projectKey}/environments/{environmentKey}/experiments Create experiment
Create an experiment.
To run this experiment, you'll need to [create an iteration](https://launchdarkly.com/docs/api/experiments/create-iteration) and then [update the experiment](https://launchdarkly.com/docs/api/experiments/patch-experiment) with the `startIteration` instruction.
### Experiment types
Use the `type` field to specify the experiment type: `experiment` (default), `mab` (multi-armed bandit), or `holdout`.
For multi-armed bandit experiments, set `reallocationFrequencyMillis` on the iteration to control how often traffic is reallocated across variations.
### Results analysis
Use the `methodology` field to specify the results analysis approach: `bayesian` (default) or `frequentist`.
Use the `dataSource` field to specify the source of metric data: `launchdarkly` (default), `snowflake`, or `databricks`.
Use the `analysisConfig` field to customize analysis settings such as the Bayesian threshold, significance threshold, or multiple comparison correction method.
To learn more, read [Creating experiments](https://launchdarkly.com/docs/home/experimentation/create).
- projectKey path required
- The project key
- string
- environmentKey path required
- The environment 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.
Code snippet
Updates live as you fill in the form above.
TypeScript
import launchdarkly from '@utdk/launchdarkly';
await launchdarkly.createexperiment()