1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/website/docs/topics/the-anatomy-of-unleash.mdx

212 lines
17 KiB
Plaintext
Raw Normal View History

docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
---
title: The Anatomy of Unleash
---
import Figure from '@site/src/components/Figure/Figure.tsx'
refactor: move docs into new structure / fix links for SEO (#2416) ## What This (admittedly massive) PR updates the "physical" documentation structure and fixes url inconsistencies and SEO problems reported by marketing. The main points are: - remove or move directories : advanced, user_guide, deploy, api - move the files contained within to the appropriate one of topics, how-to, tutorials, or reference - update internal doc links and product links to the content - create client-side redirects for all the urls that have changed. A number of the files have been renamed in small ways to better match their url and to make them easier to find. Additionally, the top-level api directory has been moved to /reference/api/legacy/unleash (see the discussion points section for more on this). ## Why When moving our doc structure to diataxis a while back, we left the "physical' files lying where they were, because it didn't matter much to the new structure. However, that did introduce some inconsistencies with where you place docs and how we organize them. There's also the discrepancies in whether urls us underscores or hyphens (which isn't necessarily the same as their file name), which has been annoying me for a while, but now has also been raised by marketing as an issue in terms of SEO. ## Discussion points The old, hand-written API docs have been moved from /api to /reference/api/legacy/unleash. There _is_ a /reference/api/unleash directory, but this is being populated by the OpenAPI plugin, and mixing those could only cause trouble. However, I'm unsure about putting /legacy/ in the title, because the API isn't legacy, the docs are. Maybe we could use another path? Like /old-docs/ or something? I'd appreciate some input on this.
2022-11-22 10:05:30 +01:00
This guide's purpose is to give you a conceptual overview of how Unleash works. It covers the various components that exist within an Unleash system and how they interact with each other and with external applications. The diagrams are intended to help you understand the fundamental building blocks, such as [projects](../reference/projects.md), [environments](../reference/environments.md), [variants](../reference/feature-toggle-variants.md) and, of course, [feature toggles](../reference/feature-toggles.mdx).
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
The end of this guide presents a [short use case, explaining how you might configure Unleash](#use-case) to start working with feature toggles.
## The root level
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
Some things in Unleash are configured and defined on the root level. These options apply across the entire Unleash instance. The most important root configuration options for day-to-day operations are:
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
- [API access tokens](../reference/api-tokens-and-client-keys.mdx)
refactor: move docs into new structure / fix links for SEO (#2416) ## What This (admittedly massive) PR updates the "physical" documentation structure and fixes url inconsistencies and SEO problems reported by marketing. The main points are: - remove or move directories : advanced, user_guide, deploy, api - move the files contained within to the appropriate one of topics, how-to, tutorials, or reference - update internal doc links and product links to the content - create client-side redirects for all the urls that have changed. A number of the files have been renamed in small ways to better match their url and to make them easier to find. Additionally, the top-level api directory has been moved to /reference/api/legacy/unleash (see the discussion points section for more on this). ## Why When moving our doc structure to diataxis a while back, we left the "physical' files lying where they were, because it didn't matter much to the new structure. However, that did introduce some inconsistencies with where you place docs and how we organize them. There's also the discrepancies in whether urls us underscores or hyphens (which isn't necessarily the same as their file name), which has been annoying me for a while, but now has also been raised by marketing as an issue in terms of SEO. ## Discussion points The old, hand-written API docs have been moved from /api to /reference/api/legacy/unleash. There _is_ a /reference/api/unleash directory, but this is being populated by the OpenAPI plugin, and mixing those could only cause trouble. However, I'm unsure about putting /legacy/ in the title, because the API isn't legacy, the docs are. Maybe we could use another path? Like /old-docs/ or something? I'd appreciate some input on this.
2022-11-22 10:05:30 +01:00
- [Projects](../reference/projects.md)
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
- [Segments](../reference/segments.mdx)
refactor: move docs into new structure / fix links for SEO (#2416) ## What This (admittedly massive) PR updates the "physical" documentation structure and fixes url inconsistencies and SEO problems reported by marketing. The main points are: - remove or move directories : advanced, user_guide, deploy, api - move the files contained within to the appropriate one of topics, how-to, tutorials, or reference - update internal doc links and product links to the content - create client-side redirects for all the urls that have changed. A number of the files have been renamed in small ways to better match their url and to make them easier to find. Additionally, the top-level api directory has been moved to /reference/api/legacy/unleash (see the discussion points section for more on this). ## Why When moving our doc structure to diataxis a while back, we left the "physical' files lying where they were, because it didn't matter much to the new structure. However, that did introduce some inconsistencies with where you place docs and how we organize them. There's also the discrepancies in whether urls us underscores or hyphens (which isn't necessarily the same as their file name), which has been annoying me for a while, but now has also been raised by marketing as an issue in terms of SEO. ## Discussion points The old, hand-written API docs have been moved from /api to /reference/api/legacy/unleash. There _is_ a /reference/api/unleash directory, but this is being populated by the OpenAPI plugin, and mixing those could only cause trouble. However, I'm unsure about putting /legacy/ in the title, because the API isn't legacy, the docs are. Maybe we could use another path? Like /old-docs/ or something? I'd appreciate some input on this.
2022-11-22 10:05:30 +01:00
- [Strategy types](../reference/activation-strategies.md) (including [custom activation strategy types](../reference/custom-activation-strategies.md))
- [Tag types](../reference/tags.md)
- [Unleash context](../reference/unleash-context.md) fields (including [custom context fields](../reference/unleash-context.md#custom-context-fields))
- Users, [user groups](../reference/rbac.md#user-groups) and [roles](../reference/rbac.md)
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
## Projects
refactor: move docs into new structure / fix links for SEO (#2416) ## What This (admittedly massive) PR updates the "physical" documentation structure and fixes url inconsistencies and SEO problems reported by marketing. The main points are: - remove or move directories : advanced, user_guide, deploy, api - move the files contained within to the appropriate one of topics, how-to, tutorials, or reference - update internal doc links and product links to the content - create client-side redirects for all the urls that have changed. A number of the files have been renamed in small ways to better match their url and to make them easier to find. Additionally, the top-level api directory has been moved to /reference/api/legacy/unleash (see the discussion points section for more on this). ## Why When moving our doc structure to diataxis a while back, we left the "physical' files lying where they were, because it didn't matter much to the new structure. However, that did introduce some inconsistencies with where you place docs and how we organize them. There's also the discrepancies in whether urls us underscores or hyphens (which isn't necessarily the same as their file name), which has been annoying me for a while, but now has also been raised by marketing as an issue in terms of SEO. ## Discussion points The old, hand-written API docs have been moved from /api to /reference/api/legacy/unleash. There _is_ a /reference/api/unleash directory, but this is being populated by the OpenAPI plugin, and mixing those could only cause trouble. However, I'm unsure about putting /legacy/ in the title, because the API isn't legacy, the docs are. Maybe we could use another path? Like /old-docs/ or something? I'd appreciate some input on this.
2022-11-22 10:05:30 +01:00
[**Projects**](../reference/projects.md) contain [feature toggles](../reference/feature-toggles.mdx) and their configurations, and a set of active [environments](../reference/environments.md).
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
All Unleash instances must have at least one project at any given time. New instances get a project called “Default”.
Pro and Enterprise customers can create, rename, and delete projects as they wish (as long as there is always **at least one project**). Open-source users, on the other hand, only get access to the Default project.
<Figure caption="Unleash projects contain one or more environments." alt="A square labeled 'project' containing another square, labeled 'environment'." img="/img/anatomy-of-unleash-environment.png"/>
## Environments and project environments
<Figure img="/img/anatomy-of-unleash-customer-tiers.png" caption="Feature toggles can be activated or deactivated independently in different environments. For instance, a feature toggle can be active in the development environment, and deactivated in the production environment. Even if their configuration is otherwise identical, deactivated feature toggles will never be considered enabled."/>
refactor: move docs into new structure / fix links for SEO (#2416) ## What This (admittedly massive) PR updates the "physical" documentation structure and fixes url inconsistencies and SEO problems reported by marketing. The main points are: - remove or move directories : advanced, user_guide, deploy, api - move the files contained within to the appropriate one of topics, how-to, tutorials, or reference - update internal doc links and product links to the content - create client-side redirects for all the urls that have changed. A number of the files have been renamed in small ways to better match their url and to make them easier to find. Additionally, the top-level api directory has been moved to /reference/api/legacy/unleash (see the discussion points section for more on this). ## Why When moving our doc structure to diataxis a while back, we left the "physical' files lying where they were, because it didn't matter much to the new structure. However, that did introduce some inconsistencies with where you place docs and how we organize them. There's also the discrepancies in whether urls us underscores or hyphens (which isn't necessarily the same as their file name), which has been annoying me for a while, but now has also been raised by marketing as an issue in terms of SEO. ## Discussion points The old, hand-written API docs have been moved from /api to /reference/api/legacy/unleash. There _is_ a /reference/api/unleash directory, but this is being populated by the OpenAPI plugin, and mixing those could only cause trouble. However, I'm unsure about putting /legacy/ in the title, because the API isn't legacy, the docs are. Maybe we could use another path? Like /old-docs/ or something? I'd appreciate some input on this.
2022-11-22 10:05:30 +01:00
[**Environments**](../reference/environments.md) in Unleash let you change how a feature toggle works in your applications different environments. For instance, while you are developing a feature, its likely that youll want it to be available in your development environment, but not in your production environment: environments let you do that. You might also want to enable a feature for only some users in your development environment, but no users in your production environment: environments let you do that.
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
Environments exist on two different levels within Unleash. The set of **all available environments is defined on the root level**. Additionally, **each project** can choose which of these root environments should be **available on the project level**. The set of environments available to any given project is **always a subset** of the set of all available environments at the root level.
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
Each project must always have **at least one** active environment.
Enterprise users can create and remove environments. Open-source and Pro customers get access to two environments: **development** and **production.**
Environments are adjacent to [feature toggles](../reference/feature-toggles.mdx) in Unleash: neither one contains the other, but they come together to let you define activation strategies.
<Figure img="/img/anatomy-of-unleash-new-feature-rollout.png" caption="You can use different activation strategies and constraints in different environments. For instance, you can show a feature only to select user IDs in development, but roll it out to 25% of your user base in production."/>
:::info Environments and API keys
When connecting an SDK to Unleash, it's the **API key that decides which environment to** fetch features for. For legacy reasons, all Unleash SDKs accept a configuration option called `environment`, but this **does not affect the environment** at all. It is an Unleash context field and a holdover from before Unleash had native environments.
:::
## Features (feature toggles)
refactor: move docs into new structure / fix links for SEO (#2416) ## What This (admittedly massive) PR updates the "physical" documentation structure and fixes url inconsistencies and SEO problems reported by marketing. The main points are: - remove or move directories : advanced, user_guide, deploy, api - move the files contained within to the appropriate one of topics, how-to, tutorials, or reference - update internal doc links and product links to the content - create client-side redirects for all the urls that have changed. A number of the files have been renamed in small ways to better match their url and to make them easier to find. Additionally, the top-level api directory has been moved to /reference/api/legacy/unleash (see the discussion points section for more on this). ## Why When moving our doc structure to diataxis a while back, we left the "physical' files lying where they were, because it didn't matter much to the new structure. However, that did introduce some inconsistencies with where you place docs and how we organize them. There's also the discrepancies in whether urls us underscores or hyphens (which isn't necessarily the same as their file name), which has been annoying me for a while, but now has also been raised by marketing as an issue in terms of SEO. ## Discussion points The old, hand-written API docs have been moved from /api to /reference/api/legacy/unleash. There _is_ a /reference/api/unleash directory, but this is being populated by the OpenAPI plugin, and mixing those could only cause trouble. However, I'm unsure about putting /legacy/ in the title, because the API isn't legacy, the docs are. Maybe we could use another path? Like /old-docs/ or something? I'd appreciate some input on this.
2022-11-22 10:05:30 +01:00
[**Feature toggles**](../reference/feature-toggles.mdx) are at the heart of Unleashs functionality. Feature toggles belong to projects and live next to project environments. In and of itself, a feature toggle doesnt do anything. You must assign [**activation strategies**](../reference/activation-strategies.md) to it for it to start taking effect.
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
refactor: move docs into new structure / fix links for SEO (#2416) ## What This (admittedly massive) PR updates the "physical" documentation structure and fixes url inconsistencies and SEO problems reported by marketing. The main points are: - remove or move directories : advanced, user_guide, deploy, api - move the files contained within to the appropriate one of topics, how-to, tutorials, or reference - update internal doc links and product links to the content - create client-side redirects for all the urls that have changed. A number of the files have been renamed in small ways to better match their url and to make them easier to find. Additionally, the top-level api directory has been moved to /reference/api/legacy/unleash (see the discussion points section for more on this). ## Why When moving our doc structure to diataxis a while back, we left the "physical' files lying where they were, because it didn't matter much to the new structure. However, that did introduce some inconsistencies with where you place docs and how we organize them. There's also the discrepancies in whether urls us underscores or hyphens (which isn't necessarily the same as their file name), which has been annoying me for a while, but now has also been raised by marketing as an issue in terms of SEO. ## Discussion points The old, hand-written API docs have been moved from /api to /reference/api/legacy/unleash. There _is_ a /reference/api/unleash directory, but this is being populated by the OpenAPI plugin, and mixing those could only cause trouble. However, I'm unsure about putting /legacy/ in the title, because the API isn't legacy, the docs are. Maybe we could use another path? Like /old-docs/ or something? I'd appreciate some input on this.
2022-11-22 10:05:30 +01:00
When creating a feature toggle, you must assign a unique (across your Unleash instance) name, a [feature toggle type](../reference/feature-toggle-types.md), a [project](../reference/projects.md) it belongs to, and an optional description. Everything except for the name can be changed later.
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
<Figure img="/img/anatomy-of-unleash-features.png" caption="Feature toggle states are evaluated independently in each environment." alt="A hierarchy showing a project containing an environment containing a feature toggle configuration."/>
## Activation strategies
<Figure img="/img/anatomy-of-unleash-strategy.png" caption="Activation strategies are applied to feature toggles on a per-environment basis and decide whether a feature is enabled or not." alt="A hierarchy displaying an environment containing a feature toggle configuration with an activation strategy."/>
refactor: move docs into new structure / fix links for SEO (#2416) ## What This (admittedly massive) PR updates the "physical" documentation structure and fixes url inconsistencies and SEO problems reported by marketing. The main points are: - remove or move directories : advanced, user_guide, deploy, api - move the files contained within to the appropriate one of topics, how-to, tutorials, or reference - update internal doc links and product links to the content - create client-side redirects for all the urls that have changed. A number of the files have been renamed in small ways to better match their url and to make them easier to find. Additionally, the top-level api directory has been moved to /reference/api/legacy/unleash (see the discussion points section for more on this). ## Why When moving our doc structure to diataxis a while back, we left the "physical' files lying where they were, because it didn't matter much to the new structure. However, that did introduce some inconsistencies with where you place docs and how we organize them. There's also the discrepancies in whether urls us underscores or hyphens (which isn't necessarily the same as their file name), which has been annoying me for a while, but now has also been raised by marketing as an issue in terms of SEO. ## Discussion points The old, hand-written API docs have been moved from /api to /reference/api/legacy/unleash. There _is_ a /reference/api/unleash directory, but this is being populated by the OpenAPI plugin, and mixing those could only cause trouble. However, I'm unsure about putting /legacy/ in the title, because the API isn't legacy, the docs are. Maybe we could use another path? Like /old-docs/ or something? I'd appreciate some input on this.
2022-11-22 10:05:30 +01:00
[**Activation strategies**](../reference/activation-strategies.md) (or just **strategies** for short) are the part of feature toggles that tell Unleash **who should get a feature**. An activation strategy is assigned to **one **feature toggle in **one **environment.
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
When you check a [feature toggle](../reference/feature-toggles.mdx) in an application, the following decides the result:
1. Is the toggle active in the current environment? If not, it will be disabled.
2. If the toggle **is** active in the current environment, the toggles strategies decide the result. As long as **at least one** of a toggles strategies resolve to true for the current context (user or application), then the toggle will be considered enabled. In other words, if you have a hundred strategies and ninety-nine of them resolve to false, but one of them resolves to true, then the toggle is enabled.
refactor: move docs into new structure / fix links for SEO (#2416) ## What This (admittedly massive) PR updates the "physical" documentation structure and fixes url inconsistencies and SEO problems reported by marketing. The main points are: - remove or move directories : advanced, user_guide, deploy, api - move the files contained within to the appropriate one of topics, how-to, tutorials, or reference - update internal doc links and product links to the content - create client-side redirects for all the urls that have changed. A number of the files have been renamed in small ways to better match their url and to make them easier to find. Additionally, the top-level api directory has been moved to /reference/api/legacy/unleash (see the discussion points section for more on this). ## Why When moving our doc structure to diataxis a while back, we left the "physical' files lying where they were, because it didn't matter much to the new structure. However, that did introduce some inconsistencies with where you place docs and how we organize them. There's also the discrepancies in whether urls us underscores or hyphens (which isn't necessarily the same as their file name), which has been annoying me for a while, but now has also been raised by marketing as an issue in terms of SEO. ## Discussion points The old, hand-written API docs have been moved from /api to /reference/api/legacy/unleash. There _is_ a /reference/api/unleash directory, but this is being populated by the OpenAPI plugin, and mixing those could only cause trouble. However, I'm unsure about putting /legacy/ in the title, because the API isn't legacy, the docs are. Maybe we could use another path? Like /old-docs/ or something? I'd appreciate some input on this.
2022-11-22 10:05:30 +01:00
Activation strategies tie feature toggles and [environments](../reference/environments.md) together. When you assign an activation strategy to a feature toggle, you do so in one environment at a time. You can assign the same strategy to the same toggle in different environments, but they will be different instances of the same strategy, and do not stay in sync. Unleash also lets you copy strategies from one environment to another.
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
refactor: move docs into new structure / fix links for SEO (#2416) ## What This (admittedly massive) PR updates the "physical" documentation structure and fixes url inconsistencies and SEO problems reported by marketing. The main points are: - remove or move directories : advanced, user_guide, deploy, api - move the files contained within to the appropriate one of topics, how-to, tutorials, or reference - update internal doc links and product links to the content - create client-side redirects for all the urls that have changed. A number of the files have been renamed in small ways to better match their url and to make them easier to find. Additionally, the top-level api directory has been moved to /reference/api/legacy/unleash (see the discussion points section for more on this). ## Why When moving our doc structure to diataxis a while back, we left the "physical' files lying where they were, because it didn't matter much to the new structure. However, that did introduce some inconsistencies with where you place docs and how we organize them. There's also the discrepancies in whether urls us underscores or hyphens (which isn't necessarily the same as their file name), which has been annoying me for a while, but now has also been raised by marketing as an issue in terms of SEO. ## Discussion points The old, hand-written API docs have been moved from /api to /reference/api/legacy/unleash. There _is_ a /reference/api/unleash directory, but this is being populated by the OpenAPI plugin, and mixing those could only cause trouble. However, I'm unsure about putting /legacy/ in the title, because the API isn't legacy, the docs are. Maybe we could use another path? Like /old-docs/ or something? I'd appreciate some input on this.
2022-11-22 10:05:30 +01:00
Unleash comes with a number of strategies built in (refer the [activation strategies documentation](../reference/activation-strategies.md) for more information on those). You can also create your own [custom activation strategies](../reference/custom-activation-strategies.md) if you need them. All strategies can be further augmented by [**strategy constraints**](../reference/strategy-constraints.md).
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
<Figure img="/img/anatomy-of-unleash-environments-strategies.png" caption="Feature toggles exist across environments and can have different activation strategies in each environment."/>
<Figure img="/img/anatomy-of-unleash-environments-strategies2.png" caption="Feature toggle activation strategies can be copied between environments. You can also create new strategies in each environment."/>
## Strategy constraints
refactor: move docs into new structure / fix links for SEO (#2416) ## What This (admittedly massive) PR updates the "physical" documentation structure and fixes url inconsistencies and SEO problems reported by marketing. The main points are: - remove or move directories : advanced, user_guide, deploy, api - move the files contained within to the appropriate one of topics, how-to, tutorials, or reference - update internal doc links and product links to the content - create client-side redirects for all the urls that have changed. A number of the files have been renamed in small ways to better match their url and to make them easier to find. Additionally, the top-level api directory has been moved to /reference/api/legacy/unleash (see the discussion points section for more on this). ## Why When moving our doc structure to diataxis a while back, we left the "physical' files lying where they were, because it didn't matter much to the new structure. However, that did introduce some inconsistencies with where you place docs and how we organize them. There's also the discrepancies in whether urls us underscores or hyphens (which isn't necessarily the same as their file name), which has been annoying me for a while, but now has also been raised by marketing as an issue in terms of SEO. ## Discussion points The old, hand-written API docs have been moved from /api to /reference/api/legacy/unleash. There _is_ a /reference/api/unleash directory, but this is being populated by the OpenAPI plugin, and mixing those could only cause trouble. However, I'm unsure about putting /legacy/ in the title, because the API isn't legacy, the docs are. Maybe we could use another path? Like /old-docs/ or something? I'd appreciate some input on this.
2022-11-22 10:05:30 +01:00
[**Strategy constraints**](../reference/strategy-constraints.md) (or just **constraints**) help you fine-tune your strategies. They are an extra layer of prerequisites that help you narrow the audience of a strategy down. Strategy constraints are applied to [**activation strategies**](../reference/activation-strategies.md).
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
For example, if you wanted to roll a feature out to 50% of users with **a specific email domain **(such as “@mycompany.com”), then strategy constraints would let you target only users with that email domain.
Constraints can also be used for more general purposes, such as timing feature releases or releasing features in specific regions.
An activation strategy can have as many constraints as you want. When an activation strategy has multiple constraints, then **every constraint **must be satisfied for the strategy to be evaluated. So if you have two constraints: one that says users must have an “@mycompany.com” email address and one that says users must have signed up for a beta program, then the strategy would **only be evaluated for users with @mycompany.com emails that have signed up for the program**.
:::tip Strategies and constraints
Feature toggle strategies are **permissive**: As long as **one** strategy resolves to true, the feature is considered enabled. On the other hand, constrains are **restrictive**: for a given strategy, **all** constraints must be met for it to resolve to true.
We can exemplify this difference with the logical operators AND and OR:
- For a feature toggle, if Strategy1 OR Strategy2 OR .. OR StrategyN is true, **then the feature is enabled**.
- For a strategy, it can be evaluated **if and only if** Constraint1 AND Constraint2 AND .. AND ConstraintN are met.
Note that even if all the constraints are met, the strategy itself might not resolve to true: that will depend on the strategy and the provided context.
:::
refactor: move docs into new structure / fix links for SEO (#2416) ## What This (admittedly massive) PR updates the "physical" documentation structure and fixes url inconsistencies and SEO problems reported by marketing. The main points are: - remove or move directories : advanced, user_guide, deploy, api - move the files contained within to the appropriate one of topics, how-to, tutorials, or reference - update internal doc links and product links to the content - create client-side redirects for all the urls that have changed. A number of the files have been renamed in small ways to better match their url and to make them easier to find. Additionally, the top-level api directory has been moved to /reference/api/legacy/unleash (see the discussion points section for more on this). ## Why When moving our doc structure to diataxis a while back, we left the "physical' files lying where they were, because it didn't matter much to the new structure. However, that did introduce some inconsistencies with where you place docs and how we organize them. There's also the discrepancies in whether urls us underscores or hyphens (which isn't necessarily the same as their file name), which has been annoying me for a while, but now has also been raised by marketing as an issue in terms of SEO. ## Discussion points The old, hand-written API docs have been moved from /api to /reference/api/legacy/unleash. There _is_ a /reference/api/unleash directory, but this is being populated by the OpenAPI plugin, and mixing those could only cause trouble. However, I'm unsure about putting /legacy/ in the title, because the API isn't legacy, the docs are. Maybe we could use another path? Like /old-docs/ or something? I'd appreciate some input on this.
2022-11-22 10:05:30 +01:00
You can define constraints on whatever properties you want in your [Unleash context](../reference/unleash-context.md).
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
Constraints are applied to individual strategies and do not stay in sync with each other. When you need to have the same constraints applied to multiple strategies and need those constraints to stay in sync, use [**segments**](../reference/segments.mdx).
<Figure img="/img/anatomy-of-unleash-constraint.png" caption="Constraints can be applied to strategies, allowing you to narrow a feature's audience." alt="A hierarchy drawing showing a constraint applied to an activation strategy."/>
## Segments
refactor: move docs into new structure / fix links for SEO (#2416) ## What This (admittedly massive) PR updates the "physical" documentation structure and fixes url inconsistencies and SEO problems reported by marketing. The main points are: - remove or move directories : advanced, user_guide, deploy, api - move the files contained within to the appropriate one of topics, how-to, tutorials, or reference - update internal doc links and product links to the content - create client-side redirects for all the urls that have changed. A number of the files have been renamed in small ways to better match their url and to make them easier to find. Additionally, the top-level api directory has been moved to /reference/api/legacy/unleash (see the discussion points section for more on this). ## Why When moving our doc structure to diataxis a while back, we left the "physical' files lying where they were, because it didn't matter much to the new structure. However, that did introduce some inconsistencies with where you place docs and how we organize them. There's also the discrepancies in whether urls us underscores or hyphens (which isn't necessarily the same as their file name), which has been annoying me for a while, but now has also been raised by marketing as an issue in terms of SEO. ## Discussion points The old, hand-written API docs have been moved from /api to /reference/api/legacy/unleash. There _is_ a /reference/api/unleash directory, but this is being populated by the OpenAPI plugin, and mixing those could only cause trouble. However, I'm unsure about putting /legacy/ in the title, because the API isn't legacy, the docs are. Maybe we could use another path? Like /old-docs/ or something? I'd appreciate some input on this.
2022-11-22 10:05:30 +01:00
[**Segments**](../reference/segments.mdx) add extra functionality on top of [**strategy constraints**](../reference/strategy-constraints.md). A segment is a reusable collection of strategy constraints with a name and an optional description. When you apply a segment to a [strategy](../reference/activation-strategies.md), the strategy will be evaluated as if all of the segment's constraints were applied to it.
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
Segments let you apply a set of constraints to multiple strategies **and** keep the constraints in sync between those strategies. Whenever you apply a segment to a strategy, you essentially create a **reference** to that segment. This means that whenever you change the segment by adding, removing, or changing constraints, this change propagates to all the strategies that reference this segment.
You can apply multiple segments to a strategy. Much like with constraints, **every segment** needs **every constraint** to be satisfied for the strategy to be evaluated. If you also have other constraints on the strategy, then those must also be satisfied.
Segments are only available to Pro and Enterprise users.
<Figure img="/img/anatomy-of-unleash-segments.png" caption="Segments are reusable lists of constraints that can be applied to a strategy instead of or in addition to constraints." />
## Variants and feature toggle payloads
refactor: move docs into new structure / fix links for SEO (#2416) ## What This (admittedly massive) PR updates the "physical" documentation structure and fixes url inconsistencies and SEO problems reported by marketing. The main points are: - remove or move directories : advanced, user_guide, deploy, api - move the files contained within to the appropriate one of topics, how-to, tutorials, or reference - update internal doc links and product links to the content - create client-side redirects for all the urls that have changed. A number of the files have been renamed in small ways to better match their url and to make them easier to find. Additionally, the top-level api directory has been moved to /reference/api/legacy/unleash (see the discussion points section for more on this). ## Why When moving our doc structure to diataxis a while back, we left the "physical' files lying where they were, because it didn't matter much to the new structure. However, that did introduce some inconsistencies with where you place docs and how we organize them. There's also the discrepancies in whether urls us underscores or hyphens (which isn't necessarily the same as their file name), which has been annoying me for a while, but now has also been raised by marketing as an issue in terms of SEO. ## Discussion points The old, hand-written API docs have been moved from /api to /reference/api/legacy/unleash. There _is_ a /reference/api/unleash directory, but this is being populated by the OpenAPI plugin, and mixing those could only cause trouble. However, I'm unsure about putting /legacy/ in the title, because the API isn't legacy, the docs are. Maybe we could use another path? Like /old-docs/ or something? I'd appreciate some input on this.
2022-11-22 10:05:30 +01:00
By default, a [feature toggle](../reference/feature-toggles.mdx) in Unleash only tells you whether a feature is enabled or disabled, but you can also add more information to your toggles by using [**feature toggle variants**](../reference/feature-toggle-variants.md). Variants also allow you to run [A/B testing experiments](a-b-testing.md).
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
Feature toggles are designed to let you decide which users get access to a feature. Variants are designed to let you decide **which version** of the feature a user gets access to. For instance, if user A is part of your beta testing program and gets access to a new beta feature, then you can use variants to decide whether they should get the red version or the green version of the feature.
When you create new variants for a feature, they must be given a name and a **weighting** indicating how many users should see this particular variant of the feature. They can also be given a **payload**.
You can use the variant payload to attach arbitrary data to a variant. Variants can have different kinds of payloads.
A feature toggle can have as many variants as you want.
### Variants and environments
Prior to 4.21, variants were independent of [environments](../reference/environments.md). In other words: if you're on 4.19 or lower, youll always have the exact same variants with the exact same weightings and the exact same payloads in all environments.
<Figure img="/img/anatomy-of-unleash-variants.png" caption="Before Unleash 4.21, feature toggle variants were the same for all environments."/>
As of version 4.21, a feature can have different variants in different environments. For instance, a development environment might have no variants, while a production environment has 2 variants. Payloads, weightings and anything else can also differ between environments.
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
<Figure img="/img/anatomy-of-unleash-variants-per-environment.png" caption="From Unleash 4.21 on, a feature toggle can have different in each environment."/>
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
## Use case: changing website colors {#use-case}
Using the concepts we have looked at in the previous sections, lets create a hypothetical case and see how Unleash would solve it.
**Problem statement:** You have an existing website with a **red** color scheme, but youre feeling a bit adventurous and would like to try and see if changing it to a blue color scheme would be better.
**Current state:** You have an existing website that gets server-side rendered and you have a newly created instance of Unleash.
### Configuring Unleash for development
Assuming you have a brand new Unleash instance, you already have the “Default” project and the “Development” and “Production” environments available. Thats going to be all you need for now.
First things first, in the Default project, you create a new feature toggle, called “new-color-scheme” (toggle names have to be URL-friendly, so no spaces allowed!).
Because youd like to see the new color scheme while youre developing it, you assign a “standard” strategy to the new-color-scheme toggle in the development environment and turn it on.
### In your application
refactor: move docs into new structure / fix links for SEO (#2416) ## What This (admittedly massive) PR updates the "physical" documentation structure and fixes url inconsistencies and SEO problems reported by marketing. The main points are: - remove or move directories : advanced, user_guide, deploy, api - move the files contained within to the appropriate one of topics, how-to, tutorials, or reference - update internal doc links and product links to the content - create client-side redirects for all the urls that have changed. A number of the files have been renamed in small ways to better match their url and to make them easier to find. Additionally, the top-level api directory has been moved to /reference/api/legacy/unleash (see the discussion points section for more on this). ## Why When moving our doc structure to diataxis a while back, we left the "physical' files lying where they were, because it didn't matter much to the new structure. However, that did introduce some inconsistencies with where you place docs and how we organize them. There's also the discrepancies in whether urls us underscores or hyphens (which isn't necessarily the same as their file name), which has been annoying me for a while, but now has also been raised by marketing as an issue in terms of SEO. ## Discussion points The old, hand-written API docs have been moved from /api to /reference/api/legacy/unleash. There _is_ a /reference/api/unleash directory, but this is being populated by the OpenAPI plugin, and mixing those could only cause trouble. However, I'm unsure about putting /legacy/ in the title, because the API isn't legacy, the docs are. Maybe we could use another path? Like /old-docs/ or something? I'd appreciate some input on this.
2022-11-22 10:05:30 +01:00
You configure an [Unleash SDK for your server](../reference/sdks/index.md) to communicate with Unleash. When rendering the page, you check the state of the new-color-scheme feature and render a different stylesheet based on the results.
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
docs: auto-generate remaining server-side SDK docs (#2858) This PR builds on the preceding doc auto-generation PRs and generates documentation for the remaining server-side SDKs. ## Why Refer to https://github.com/Unleash/unleash/pull/2809 for more context about generating SDK docs. ## What - Adds generation for the remaining server-side SDKs - Moves generated docs from the `/reference/sdks` directory to `/generated` directory. - Makes sure that the URLs do not change because of the move by using the `slug` frontmatter property. - replaces relative github links in the markdown documents so that they become absolute github links. (refer to the next section) - Updates some image styling so that it doesn't apply to readme badges (we don't need them using `display: block`) ### On link replacing: This PR adds handling of links in the generated documentation. Specifically, it changes links in one case: Relative links to github. Links to code and other files in the repository. These are prefixed with the repository's URL. While this should work in most cases, it will fail in cases where the links to the files are not on the repository's primary branch. (typically main, but could also be "v3", for instance). In these cases, the links will get a double branch in the URL and will fail. However, I see no easy way around this (though suggestions are definitely accepted!), and think it's a fair tradeoff. It takes the links from "definitely failing" to "will work in the vast majority of cases". Note: I originally also wanted to handle the case where the link is an absolute link to docs.getunleash.io. We could turn these into relative urls to avoid full page reloads and enjoy a smoother experience. However, the client-side redirects don't work correctly if the relative URL goes to a redirect page, so you end up with a 404 page. As such, I think it's better to leave the links as absolute for now.
2023-01-13 12:40:28 +01:00
In pseudocode (loosely based on the [Node.js SDK](/docs/generated/sdks/server-side/node.md)), that might look like this:
docs: add "The Anatomy of Unleash" (#2138) ## What This PR 1. adds a new topic document, "The Anatomy of Unleash", which explains how Unleash is built up as a system. 2. It also moves the "topic guides" sidebar entry from position 4 to position 2. 3. Finally, it introduces a new `Figure` component for the documentation, to be used with images that should be shown with captions. ## Why Referring to the same numbers as mentioned above, here's some background for these changes: 1. We have gotten requests from enterprise users for a way to help new Unleash users understand the system. Together with customer success and customer journey, we agreed that an explanatory guide would be suitable. It aims to give the reader an introduction into what pieces constitute the Unleash system. 2. As part of a discussion, it was suggested to move topic guides higher up to make them more visible. There's a few reasons for this: 1. New users of Unleash should be able to keep reading about Unleash after the basic introductory material. When left at the bottom, topic guides are often overlooked 2. As a justification, it was proposed that reference docs are often the last thing you look for, so it makes sense to put that last. 3. Thinking about a new user's flow, it also makes some sense: first read introductory material, then dive deeper into what Unleash is and what you can use it for, then look for how-to guides if you're stuck, and finally consult the reference material for later. 3. These diagrams aren't necessarily very self-explanatory, so adding a caption makes a lot of sense. We didn't have a component from this previously, so I added one. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> ## Commits * docs: add raw export of anatomy document * docs: move the topic guides section to near top of sidebar * docs: add inter-doc links, some reformatting * docs: fix broken links * docs: add a Figure element for figures with captions * docs: add more styling to figures * docs: align on styles * Fix: add fuller figure caption * docs: rephrase heading * Docs(test): try new way of importing images * Docs(test): images take 3 * docs: Convert all images to using the figure component * docs: add projects to list of top-level resources * docs: add captions for all figures. * docs: reorder images * Docs(fix): typo: extra brackets * Docs(style): remove box shadows and border on fig caption images * Docs(chore): remove commented-out css * Docs(refactor): use css variable for small font size. To facilitate reusability and convey meaning. * docs: rename anatomy doc * docs: add note about strategies vs constraints * Updating the images * Apply suggestions from code review Co-authored-by: Simon Hornby <liquidwicked64@gmail.com> * Update website/docs/topics/the-anatomy-of-unleash.mdx * Docs(fix): remove redundant comma * docs: add link to node js sdk * docs: mention that a toggle must be active in an env to be enabled * docs: add note about environments and api keys * Docs(reword): swap dev and prod in example * docs: fix typo in the image * docs: make figures in text full-width * docs: move environments and API keys call-out to after figure * docs: add borders to figures * docs: add image float css idea * Revert "docs: add image float css idea" This reverts commit 69f27d304b4a4d2a7422046475380011345736a2. Co-authored-by: NicolaeUnleash <103567375+NicolaeUnleash@users.noreply.github.com> Co-authored-by: Simon Hornby <liquidwicked64@gmail.com>
2022-10-19 13:14:49 +02:00
```js
if (unleash.isEnabled(“new-color-scheme”)) {
// load stylesheet with new color scheme
} else {
// load stylesheet with old color scheme
}
```
And with that, the new color scheme is now live in your development environment. Because there arent any strategies defined in the production environment yet, the feature is not active, and everything is as it was.
### Rolling out the feature to users
When youre happy with the new color scheme, you decide to start rolling it out to users. But you want it to go out to only a small number of users at first, so that you can get some feedback while rolling out.
You decide to add a _gradual rollout_ strategy to the new-color-scheme feature in the production environment. Because you want to start small, you set the rollout percentage to 5%.
As soon as you enable the production environment, the feature gets rolled out to 5% of your users (assuming youve deployed the code to production).
### Adding variants
While you were developing the new color scheme, you also dabbled a bit with other colors in addition to blue: green and purple might be nice too! So you decide to create two extra color schemes that youre happy with. But youd like to hear what your users think too, so you need to roll it out to them somehow.
You decide to use feature toggle variants to differentiate between the different themes, creating three variants: blue, green, and purple. You want each of them to roll out to the same number of users, so you leave them equally weighted.
```js
const theme = unleash.getVariant(“new-color-scheme”).name;
if (theme === “green”) {
// load stylesheet with green color scheme
} else if (theme === “blue”) {
// load stylesheet with blue color scheme
} else if (theme === “purple”) {
// load stylesheet with purple color scheme
} else {
// load stylesheet with old color scheme
}
```
Now users that are included in the gradual rollout will get one of the three themes. Users that arent included get the old theme.