Skip to content

Commit

Permalink
chore: rename toggle to flags in docs #2 (#7141)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaanus committed May 24, 2024
1 parent 8b5e39c commit 83dfdc7
Show file tree
Hide file tree
Showing 25 changed files with 159 additions and 159 deletions.
12 changes: 6 additions & 6 deletions website/docs/how-to/how-to-add-strategy-constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ Before Unleash 4.16, strategy constraints were only available to Unleash Pro and

:::

This guide shows you how to add [strategy constraints](../reference/strategy-constraints.md) to your feature toggles via the admin UI. For information on how to interact with strategy constraints from an [Unleash client SDK](../reference/sdks/index.md), visit the specific SDKs documentation or see [the relevant section in the strategy constraints documentation](../reference/strategy-constraints.md#sdks 'strategy constraints documentation, section on interacting with constraints from client SDKs').
This guide shows you how to add [strategy constraints](../reference/strategy-constraints.md) to your feature flags via the admin UI. For information on how to interact with strategy constraints from an [Unleash client SDK](../reference/sdks/index.md), visit the specific SDKs documentation or see [the relevant section in the strategy constraints documentation](../reference/strategy-constraints.md#sdks 'strategy constraints documentation, section on interacting with constraints from client SDKs').

## Prerequisites

You'll need to have an existing feature toggle with a defined strategy to add a constraint. The rest of this guide assumes you have a specific strategy that you're working with.
You'll need to have an existing feature flag with a defined strategy to add a constraint. The rest of this guide assumes you have a specific strategy that you're working with.

## Step 1: Open the constraints menu {#step-1}

On the strategy you're working with, find and select the "edit strategy" button.

![A feature toggle with one strategy. The "edit strategy" button is highlighted.](/img/create-toggle-edit-strategy.png)
![A feature flag with one strategy. The "edit strategy" button is highlighted.](/img/create-toggle-edit-strategy.png)

On the "edit strategy" screen, select the "add constraint" button to open the constraints menu.

![A feature toggle strategy view showing a button labeled with add constraints.](/img/add-constraint.png)
![A feature flag strategy view showing a button labeled with add constraints.](/img/add-constraint.png)

## Step 2: Add and configure the constraint {#step-2}

Expand All @@ -36,10 +36,10 @@ Refer to [the _constraint structure_ section of the strategy constraints referen

## Step 3: Save the strategy {#step-3}

![A feature toggle strategy view showing a button at the end of the form labeled with save strategy.](/img/constraints-save-strategy.png)
![A feature flag strategy view showing a button at the end of the form labeled with save strategy.](/img/constraints-save-strategy.png)

## How to update existing constraints

To update an existing constraint, find the constraint in the "edit strategy" screen and use the constraint's "edit" button.

![A strategy form showing an existing constraint with existing values and 2 buttons, the "edit" button is highlighted.](/img/constraints-edit.png)
![A strategy form showing an existing constraint with existing values and 2 buttons, the "edit" button is highlighted.](/img/constraints-edit.png)
2 changes: 1 addition & 1 deletion website/docs/how-to/how-to-clone-environments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Environment cloning was made available in Unleash 4.19.

:::

[Environment cloning](../reference/environments.md#cloning-environments) enables Unleash admins to duplicate existing environments, including all feature toggles strategies and their state.
[Environment cloning](../reference/environments.md#cloning-environments) enables Unleash admins to duplicate existing environments, including all feature flags strategies and their state.

## Step 1: Navigate to the environments page {#step-1}

Expand Down
40 changes: 20 additions & 20 deletions website/docs/how-to/how-to-create-feature-toggles.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
title: How to create a feature flag
---

:::info Feature flags or feature toggles?
:::info Feature flags or feature flags?

This document uses **feature flags** and **feature toggles** interchangeably. Some people prefer flag; others prefer toggle. We use both - they are synonyms for us.
This document uses **feature flags** and **feature flags** interchangeably. Some people prefer flag; others prefer flag. We use both - they are synonyms for us.

:::

Feature Flags (or [Feature toggles](../reference/feature-toggles.mdx) in the UI) are the foundation of Unleash. They are at the core of everything we do and are a fundamental building block in any feature management system. This guide shows you how to create feature flags in Unleash and how to add any optional constraints, segments, variants, and more. Links to learn more about these concepts will be scattered throughout the text.
Feature Flags (or [Feature flags](../reference/feature-toggles.mdx) in the UI) are the foundation of Unleash. They are at the core of everything we do and are a fundamental building block in any feature management system. This guide shows you how to create feature flags in Unleash and how to add any optional constraints, segments, variants, and more. Links to learn more about these concepts will be scattered throughout the text.

You can perform every action both via the UI and the admin API. This guide includes screenshots to highlight the relevant UI controls and links to the relevant API methods for each step.

Expand All @@ -26,12 +26,12 @@ To perform all the steps in this guide, you will need:
- A project to hold the flag
- A user with an **editor** or **admin** role OR a user with the following permissions inside the target project:
- **[project-level permissions](../reference/rbac.md#project-permissions)**
- create feature toggles
- create feature flags
- **[environment-level permissions](../reference/rbac.md#environment-permissions)**
- create/edit variants[^1]
- create activation strategies
- update activation strategies
- enable/disable toggles
- enable/disable flags

:::info roles

Expand All @@ -41,47 +41,47 @@ Refer to [the documentation on role-based access control](../reference/rbac.md)

## Required steps

This section takes you through the required steps to create and activate a feature toggle. It assumes that you have all the prerequisites from the previous section done.
This section takes you through the required steps to create and activate a feature flag. It assumes that you have all the prerequisites from the previous section done.

### Step 1: Create a toggle {#step-1}
### Step 1: Create a flag {#step-1}

:::tip API: create a toggle
:::tip API: create a flag

Use the [Admin API endpoint for creating a feature toggle](/reference/api/legacy/unleash/admin/features-v2.md#create-toggle). The payload accepts all the same fields as the Admin UI form. The Admin UI also displays the corresponding cURL command when you use the form.
Use the [Admin API endpoint for creating a feature flag](/reference/api/legacy/unleash/admin/features-v2.md#create-toggle). The payload accepts all the same fields as the Admin UI form. The Admin UI also displays the corresponding cURL command when you use the form.

:::

In the project that you want to create the toggle in, use the "new feature toggle" button and fill the form out with your desired configuration. Refer to the [feature toggle reference documentation](../reference/feature-toggles.mdx) for the full list of configuration options and explanations.
In the project that you want to create the flag in, use the "new feature flag" button and fill the form out with your desired configuration. Refer to the [feature flag reference documentation](../reference/feature-toggles.mdx) for the full list of configuration options and explanations.

![](/img/create-toggle-new-toggle.png)

### Step 2: Add a strategy {#step-2}

:::tip API: Add a strategy

Use the [API for adding a strategy to a feature toggle](/reference/api/legacy/unleash/admin/features-v2.md#add-strategy). You can find the configuration options for each strategy in the [activation strategy reference documentation](../reference/activation-strategies.md).
Use the [API for adding a strategy to a feature flag](/reference/api/legacy/unleash/admin/features-v2.md#add-strategy). You can find the configuration options for each strategy in the [activation strategy reference documentation](../reference/activation-strategies.md).

:::

Decide which environment you want to enable the toggle in. Select that environment and add an activation strategy. Different activation strategies will act differently as described in the [activation strategy documentation](../reference/activation-strategies.md). The configuration for each strategy differs accordingly. After selecting a strategy, complete the steps to configure it.
Decide which environment you want to enable the flag in. Select that environment and add an activation strategy. Different activation strategies will act differently as described in the [activation strategy documentation](../reference/activation-strategies.md). The configuration for each strategy differs accordingly. After selecting a strategy, complete the steps to configure it.

![](/img/create-toggle-add-strategy.png)

### Step 3: Enable the toggle {#step-3}
### Step 3: Enable the flag {#step-3}

:::tip API: Enable a toggle
:::tip API: Enable a flag

Use the [API for enabling an environment for a toggle](/reference/api/legacy/unleash/admin/features-v2.md#enable-env) and specify the environment you'd like to enable.
Use the [API for enabling an environment for a flag](/reference/api/legacy/unleash/admin/features-v2.md#enable-env) and specify the environment you'd like to enable.

:::

Use the environments toggles to switch on the environment that you chose above. Depending on the activation strategy you added in the previous step, the toggle should now evaluate to true or false depending on the Unleash context you provide it.
Use the environments flags to switch on the environment that you chose above. Depending on the activation strategy you added in the previous step, the flag should now evaluate to true or false depending on the Unleash context you provide it.

![](/img/create-toggle-enable-env.png)

## Optional steps

These optional steps allow you to further configure your feature toggles to add optional payloads, variants for A/B testing, more detailed user targeting and exceptions/overrides.
These optional steps allow you to further configure your feature flags to add optional payloads, variants for A/B testing, more detailed user targeting and exceptions/overrides.

### Add constraints and segmentation

Expand All @@ -95,7 +95,7 @@ To add constraints and segmentation, use the "edit strategy" button for the desi

:::info

Constraints aren't fixed and can be changed later to further narrow your audience. You can add them either when you add a strategy to a toggle or at any point thereafter.
Constraints aren't fixed and can be changed later to further narrow your audience. You can add them either when you add a strategy to a flag or at any point thereafter.

:::

Expand Down Expand Up @@ -131,7 +131,7 @@ In the strategy configuration screen for the strategy that you want to configure

:::info

This can be done at any point after you've created your toggle.
This can be done at any point after you've created your flag.

:::

Expand All @@ -141,7 +141,7 @@ Use the [update variants endpoint](/reference/api/legacy/unleash/admin/features-

:::

[Variants](../reference/feature-toggle-variants.md) give you the ability to further target your users and split them into groups of your choosing, such as for A/B testing. On the toggle overview page, select the variants tab. Use the "new variant" button to add the variants that you want.
[Variants](../reference/feature-toggle-variants.md) give you the ability to further target your users and split them into groups of your choosing, such as for A/B testing. On the flag overview page, select the variants tab. Use the "new variant" button to add the variants that you want.

![](/img/create-toggle-add-variants.png)

Expand Down
14 changes: 7 additions & 7 deletions website/docs/how-to/how-to-import-export.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Api admin state is deprecated from version 5. We recommend using the new [Enviro

:::

Unleash supports import and export of feature toggles and strategies at startup and during runtime. The main purpose of the import/export feature is to bootstrap new Unleash instances with feature toggles and their configuration. If you are looking for a granular way to keep separate Unleash instances in sync we strongly recommend that you take a look at the Unleash Admin APIs.
Unleash supports import and export of feature flags and strategies at startup and during runtime. The main purpose of the import/export feature is to bootstrap new Unleash instances with feature flags and their configuration. If you are looking for a granular way to keep separate Unleash instances in sync we strongly recommend that you take a look at the Unleash Admin APIs.

The import mechanism guarantees that:
- all imported features will be non-archived
Expand Down Expand Up @@ -48,7 +48,7 @@ await stateService.importFile({file: 'exported-data.yml', userName: 'import', dr

If you want the database to be cleaned before import (all strategies and features will be removed), set the `dropBeforeImport` parameter.

It is also possible to not override existing feature toggles (and strategies) by using the `keepExisting` parameter.
It is also possible to not override existing feature flags (and strategies) by using the `keepExisting` parameter.

### API Export {#api-export}

Expand Down Expand Up @@ -86,7 +86,7 @@ You can customize the import with query parameters:
| Parameter | Default | Description |
| --- | --- | --- |
| drop | `false` | If the database should be cleaned before import (see comment below) |
| keep | `true` | If true, the existing feature toggles and strategies will not be overridden |
| keep | `true` | If true, the existing feature flags and strategies will not be overridden |

If you want the database to be cleaned before import (**all strategies and features will be removed**), specify a `drop` query parameter.

Expand All @@ -98,11 +98,11 @@ You should be cautious about using the `drop` query parameter in production envi

Example usage:

<ApiRequest verb="post" url="api/admin/state/import" payload={{ "version": 3, "features": [{"name": "a-feature-toggle", "enabled": true, "description": "#1 feature-toggle"}] }} title="Import data into Unleash."/>
<ApiRequest verb="post" url="api/admin/state/import" payload={{ "version": 3, "features": [{"name": "a-feature-flag", "enabled": true, "description": "#1 feature-flag"}] }} title="Import data into Unleash."/>

## Startup import {#startup-import}

You can import toggles and strategies on startup by using an import file in JSON or YAML format. As with other forms of imports, you can also choose to remove the current toggle and strategy configuration in the database before importing.
You can import flags and strategies on startup by using an import file in JSON or YAML format. As with other forms of imports, you can also choose to remove the current flag and strategy configuration in the database before importing.

Unleash lets you do this both via configuration parameters and environment variables. The relevant parameters/variables are:

Expand All @@ -113,7 +113,7 @@ Unleash lets you do this both via configuration parameters and environment varia

### Importing files

To import strategies and toggles from a file (called `configuration.yml` in the examples below), either
To import strategies and flags from a file (called `configuration.yml` in the examples below), either
- use the `importFile` parameter to point to the file (you can also pass this into the `unleash.start()` entry point)
``` shell
unleash-server --databaseUrl [...] \
Expand All @@ -131,7 +131,7 @@ To import strategies and toggles from a file (called `configuration.yml` in the
You should never use this in production environments.
:::

To remove pre-existing feature toggles and strategies in the database before importing the new ones, either:
To remove pre-existing feature flags and strategies in the database before importing the new ones, either:
- add the `dropBeforeImport` flag to the `unleash-server` command (or to `unleash.start()`)
``` shell
unleash-server --databaseUrl [...] \
Expand Down
6 changes: 3 additions & 3 deletions website/docs/how-to/how-to-run-the-unleash-proxy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Placeholders in the code samples below are delimited by angle brackets (i.e. `<p

:::

The [Unleash Proxy](../generated/unleash-proxy.md) provides a way for you to consume feature toggles in [front-end clients](../reference/sdks/index.md#front-end-sdks), such as the [JavaScript Proxy client](/docs/generated/sdks/client-side/javascript-browser.md) and [React Proxy client](/docs/generated/sdks/client-side/react.md).
The [Unleash Proxy](../generated/unleash-proxy.md) provides a way for you to consume feature flags in [front-end clients](../reference/sdks/index.md#front-end-sdks), such as the [JavaScript Proxy client](/docs/generated/sdks/client-side/javascript-browser.md) and [React Proxy client](/docs/generated/sdks/client-side/react.md).

Depending on your setup, the Proxy is most easily run in one of two ways, depending on your situation:

Expand Down Expand Up @@ -107,6 +107,6 @@ app.listen(port, () =>

## Verify that the proxy is working

When the proxy process has started up correctly, you can start querying its `/proxy` endpoint. If it's running correctly, you'll get back a JSON object with a list of toggles. The list may be empty if you haven't added any toggles for the corresponding project/environment yet.
When the proxy process has started up correctly, you can start querying its `/proxy` endpoint. If it's running correctly, you'll get back a JSON object with a list of flags. The list may be empty if you haven't added any flags for the corresponding project/environment yet.

<ApiRequest verb="get" url="proxy" endpointType="proxy" title="Request toggles from the Unleash Proxy"/>
<ApiRequest verb="get" url="proxy" endpointType="proxy" title="Request flags from the Unleash Proxy"/>
6 changes: 3 additions & 3 deletions website/docs/how-to/how-to-schedule-feature-releases.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ In this guide we'll schedule a feature for release at some point in time. The ex
This guide assumes that you've got the following:
- some basic experience with Unleash
- a running instance of Unleash and connected clients (where applicable)
- an existing feature toggle that you want to schedule the release for
- an existing feature flag that you want to schedule the release for

## Schedule feature releases with strategy constraints {#strategy-constraints}

Expand All @@ -41,7 +41,7 @@ To schedule a feature release via the UI:

#### Scheduling a release via the API

To add an activation strategy via the Admin API, use the feature's `strategies` endpoint to add a new strategy (see the [API documentation for adding strategies to feature toggles](/reference/api/legacy/unleash/admin/features-v2.md#add-strategy) for more details).
To add an activation strategy via the Admin API, use the feature's `strategies` endpoint to add a new strategy (see the [API documentation for adding strategies to feature flags](/reference/api/legacy/unleash/admin/features-v2.md#add-strategy) for more details).

The payload's `"name"` property should contain the name of the strategy to apply (see [activation strategies reference documentation](../reference/activation-strategies.md) for all built-in strategies' _modeling names_).

Expand Down Expand Up @@ -74,7 +74,7 @@ To schedule feature releases without using strategy constraints, you can use cus
2. Give the strategy a required string parameter where the user can enter the time at which the feature should activate. Be sure to describe the format that the user must adhere to.
3. Save the strategy

[**Apply the strategy** to the feature toggle](../how-to/how-to-use-custom-strategies.md#step-2) you want to schedule.
[**Apply the strategy** to the feature flag](../how-to/how-to-use-custom-strategies.md#step-2) you want to schedule.


![A custom activation strategy definition for a strategy called `enableAfter`. It takes a required parameter called `start time`: a string in a date format.](/img/custom-strategy-enable-after.png)
Expand Down

0 comments on commit 83dfdc7

Please sign in to comment.