mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
5a3f418e13
* Docs: write down the currently available steps * docs: quick updates to the projects page. * docs: further scaffold the how-to guide * docs: add feature-toggle.mdx (toggle reference doc) * docs: Add note that feature toggle names must be unique * docs: add API doc links * docs: delete old content * docs: delete old images * docs: update variants text * docs: update introduction * docs: add new images, update api annotations * docs: add links to context fields, improve link text for other links. * docs: remove redundant wording. * docs: fix default project for toggles * docs: typo: singular -> plural * docs: mention admin ui curl command * docs: remove leftover words * docs: improve linking to default project. * Apply suggestions from code review Co-authored-by: sighphyre <liquidwicked64@gmail.com> * Apply suggestions from code review Co-authored-by: sighphyre <liquidwicked64@gmail.com> * docs: clarify constraint timing * docs: apply suggestion from code review * docs: add link to variants document * docs: Add sections on environments and projects, link from ft docs * docs: minor rewording into unleash context. * docs: remove misleading section about "all strats evaluated" * docs: evaluate -> resolve Co-authored-by: sighphyre <liquidwicked64@gmail.com>
40 lines
3.6 KiB
Plaintext
40 lines
3.6 KiB
Plaintext
---
|
|
title: Feature Toggles
|
|
---
|
|
|
|
Feature toggles are the central concept that we built Unleash around. In Unleash, feature toggles are organized within [projects](../user_guide/projects.md). Feature toggles can have different [activation strategies](../user_guide/activation-strategies.md) for each of their project's [environments](../user_guide/environments.md), and can also be given [variants](../advanced/feature-toggle-variants.md) to facilitate A/B testing.
|
|
|
|
## Configuration options
|
|
|
|
Each feature toggle has the following configuration options
|
|
|
|
| Option | Required? | Default value | Description |
|
|
| --- | --- | --- | --- |
|
|
| name | Yes | N/A | The feature toggle's name. Must be URL-friendly according to [section 2.3 of RFC 3986](https://www.rfc-editor.org/rfc/rfc3986#section-2.3) and must be unique within your Unleash instance. |
|
|
| feature toggle type | Yes | Release | The [feature toggle's type](../advanced/feature-toggle-types.md). |
|
|
| project | Yes | The [default project](../user_guide/projects.md#the-default-project). When created from a project page in the admin UI, that project will be the default value instead. | The [project](../user_guide/projects.md) that should contain the feature toggle. |
|
|
| description | No | N/A | A description of the feature toggle's purpose. |
|
|
| enable impression data | Yes | No | Whether to enable [impression data](../advanced/impression-data.md) for this toggle or not. |
|
|
|
|
## Environments
|
|
|
|
You probably won't want to use the same configuration to enable a toggle in development as you do in production. That's why feature toggles have different activation strategy configurations for each environment.
|
|
|
|
You can enable and disable a toggle independently in each of the [project's environments](../user_guide/projects.md#projects-and-environments). When you disable a toggle in an environment, it will always evaluate to false in that environment. When you enable a toggle in an environment, the toggle will evaluate to true or false depending on its activation strategies.
|
|
|
|
Refer to the [documentation on environments](../user_guide/environments.md) for more details on how environments work.
|
|
|
|
## Activation strategies
|
|
|
|
To enable a feature in an environment, you must assign it at least one activation strategy. A feature toggle's activation strategies determine whether the toggle gets enabled for a particular [Unleash context](../user_guide/unleash-context.md) (typically a user). When using multiple strategies in a single environment, only a single strategy needs to evaluate to true for the toggle to get enabled for a user. Whenever Unleash evaluates a toggle, it will evaluate strategies in the current environment until one of them resolves to true. If no strategies resolve to true, then the toggle's value is false.
|
|
|
|
Refer to the [activation strategies documentation](../user_guide/activation-strategies.md) for a detailed description of all the built-in strategies.
|
|
|
|
## Variants
|
|
|
|
[Variants](../advanced/feature-toggle-variants.md) adds another dimension of flexibility to feature toggles. Each feature toggle can be assigned any number of variants which will then get distributed amongst your users based on your choice of [context field](../user_guide/unleash-context.md#structure). You can find out more about variants in the [variants docs](../advanced/feature-toggle-variants.md).
|
|
|
|
### Creating toggles with payloads
|
|
|
|
While variants are most often used for A/B testing and the like, you can also use variants to assign a constant payload to a toggle. If you give a toggle only a single variant and that variant has a payload, then all users variants will receive that payload.
|