Use flags to remotely control the behavior of your application. Confidence Flags in Portal lets you remotely control the behavior in your application, like a website or a mobile app. For example, use flags to control the visibility of a feature, the behavior of a feature, or the behavior of a service.Documentation Index
Fetch the complete documentation index at: https://backstage.spotify.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Create a Flag
Follow these steps to create a flag:- Go to your Portal instance and select Confidence flags on the left sidebar.
- Click + Create to create a new flag.
- Give the flag a name that can be used to uniquely identify it. It can’t be changed later, so choose wisely.
- Select the clients that can use the flag.
- Go to your Portal instance and select Confidence flags on the left sidebar.
- Go to the flag you want to preview the code for.
- Click Code snippets on the right sidebar.
- Select client and credential that you want to preview the code for.
- Pick the SDK you’re interested in.
- Go to your Portal instance and select Confidence flags on the left sidebar.
- Select the flag you want to add a client to.
- Click the icon next to Clients on the right sidebar to open up the clients dialog.
- Select the clients that should be able to resolve the flag.
- Click Save.
Archive a Flag
When a flag is no longer needed, you can archive it. Archiving a flag prevents clients from resolving and using it.- Go to your Portal instance, and select Confidence flags on the left sidebar.
- Select the flag you want to archive.
- Click Archive in the right menu.
Edit Schema
Flags don’t just describe a boolean decision to enable or disable a feature. Instead, flags have multiple properties that you use to control multiple aspects of the experience. The flag schema defines the available properties and their data type. The schema lets applications consume the flag value while knowing what to expect. Confidence supports the following data types in the schema:| Type | Description | Example values |
|---|---|---|
| String | A string | "HELO" |
| Integer | An integer | 42, 199932 |
| Double | A double | 3.14, 50.0 |
| Boolean | Boolean | true, false |
| Struct | Nested structure | { age: 23, country: "SE } |
- Go to your Portal instance.
- On the left sidebar, select Confidence flags.
- Go to the flag you want to edit the schema for.
- Click the edit icon next to Schema at the right sidebar of the flag detail page.
- Click Add property to add a new field to the schema.
- Select the type of the field, and give it a name.
Create a Variant
Use variants to implement different experiences of a flag. A variant is a named set of values for the properties of the flag. To create a variant, follows these steps.- Go to your Portal instance.
- On the left sidebar, select Confidence flags.
- Go to the flag you want to add a variant to.
- Click Create variant on the flag page.
- Enter a name for the variant, and click Next.
- Optional. Enter a description, and input values for the properties of the flag.