


Control user roles, groups, and fine-grained permissions
+Set up authentication methods including SSO, SAML, LDAP, and 2FA
+Single sign-on integration with SAML, Okta, LDAP, and Microsoft ADFS
+Platform security settings and best practices
+Track changes and access for compliance auditing
+Understand platform limits and request overrides
+Mass operations for features, segments, and identities
+Migrate complete organisations between instances
+Configure environment-level options and configurations
+System monitoring and performance metrics
+Track and analyse API usage and billing
+
GET\_[FLAGS|IDENTITIES]\_ENDPOINT_CACHE_SECONDS | Number of seconds to cache the response to `GET /api/v1/flags` | `60` | `0` |
-| GET\_[FLAGS|IDENTITIES]\_ENDPOINT_CACHE_BACKEND | Python path to the django cache backend chosen. See documentation [here](https://docs.djangoproject.com/en/4.2/topics/cache/). | `django.core.cache.backends.memcached.PyMemcacheCache` | `django.core.cache.backends.dummy.DummyCache` |
-| GET\_[FLAGS|IDENTITIES]\_ENDPOINT_CACHE_LOCATION | The location for the cache. See documentation [here](https://docs.djangoproject.com/en/4.2/topics/cache/). | `127.0.0.1:11211` | `get_flags_endpoint_cache` |
-
-An example configuration to cache both flags and identities requests for 30 seconds in a memcached instance hosted at
-`memcached-container`:
-
-```
-GET_FLAGS_ENDPOINT_CACHE_SECONDS: 30
-GET_FLAGS_ENDPOINT_CACHE_BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
-GET_FLAGS_ENDPOINT_CACHE_LOCATION: memcached-container:11211
-GET_IDENTITIES_ENDPOINT_CACHE_SECONDS: 30
-GET_IDENTITIES_ENDPOINT_CACHE_BACKEND: django.core.cache.backends.memcached.PyMemcacheCache
-GET_IDENTITIES_ENDPOINT_CACHE_LOCATION: memcached-container:11211
-```
-
-### Environment authentication caching
-
-On each request using the X-Environment-Key header, the flagsmith application retrieves the environment to perform the
-relevant caching. This can be configured using environment variables to create a shared cache with a longer timeout. The
-cache will be cleared automatically by certain actions in the platform when the environment changes.
-
-| Environment Variable | Description | Example value | Default |
-| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------ | --------------------------------------------- |
-| `ENVIRONMENT_CACHE_SECONDS` | Number of seconds to cache the environment for | `60` | `86400` ( = 24h) |
-| `ENVIRONMENT_CACHE_BACKEND` | Python path to the django cache backend chosen. See documentation [here](https://docs.djangoproject.com/en/4.2/topics/cache/). | `django.core.cache.backends.memcached.PyMemcacheCache` | `django.core.cache.backends.dummy.DummyCache` |
-| `ENVIRONMENT_CACHE_LOCATION` | The location for the cache. See documentation [here](https://docs.djangoproject.com/en/4.2/topics/cache/). | `127.0.0.1:11211` | `environment-objects` |
-
-
-### Environment document caching
-
-When configuring the environment document caching, there are 2 options: persistent or expiring. The expiring cache
-will expire after a configurable period. The benefit of this option is that it can be used with all cache
-backends, including those without a centralised storage mechanism. Bear in mind that this will mean, however, that
-changes will take up to the configured timeout to be reflected in your Flagsmith clients. The persistent cache instead
-makes use of an automated process to rebuild the cache whenever a change is made.
-
-:::warning
-
-Persistent cache should only be used with cache backends that offer a centralised cache. It should not be used with
-e.g. LocMemCache.
-
-:::
-
-:::info
-
-When using a persistent cache, a change can take a few seconds to update the cache. This can also be optimised by
-increasing the performance of your task processor.
-
-:::
-
-
-| Environment Variable | Description | Example value | Default |
-| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | --------------------------------------------- |
-| `CACHE_ENVIRONMENT_DOCUMENT_MODE` | The caching mode. One of `PERSISTENT` or `EXPIRING`. Note that although the default is `EXPIRING` there is no caching by default due to the default value of `CACHE_ENVIRONMENT_DOCUMENT_SECONDS` | `PERSISTENT` | `EXPIRING` |
-| `CACHE_ENVIRONMENT_DOCUMENT_SECONDS` | Number of seconds to cache the environment for (only relevant when `CACHE_ENVIRONMENT_DOCUMENT_MODE=EXPIRING`) | `60` | `0` ( = don't cache) |
-| `CACHE_ENVIRONMENT_DOCUMENT_BACKEND` | Python path to the django cache backend chosen. See documentation [here](https://docs.djangoproject.com/en/4.2/topics/cache/). | `django.core.cache.backends.memcached.PyMemcacheCache` | `django.core.cache.backends.db.DatabaseCache` |
-| `CACHE_ENVIRONMENT_DOCUMENT_LOCATION` | The location for the cache. See documentation [here](https://docs.djangoproject.com/en/4.2/topics/cache/). | `127.0.0.1:11211` | `environment-documents` |
-| `CACHE_ENVIRONMENT_DOCUMENT_OPTIONS` | JSON object representing any additional options required by the specific cache backend. See [here](https://docs.djangoproject.com/en/4.2/topics/cache/#cache-arguments) for further information. | `{"PASSWORD": "securepassword"}` | {} |
-
-
-
-#### Example 1. Expiring local memory cache with 60 second timeout
-
-The following environment variables provide an example for specifying a cache local to each API instance that
-expires after 60 seconds. This can be useful in deployments with just a few environments, where there is flexibility
-on how long a change to the flags should take to propagate to the clients.
-
-```
-CACHE_ENVIRONMENT_DOCUMENT_SECONDS: "60"
-CACHE_ENVIRONMENT_DOCUMENT_BACKEND: "django.core.cache.backends.locmem.LocMemCache"
-```
-
-#### Example 2. Persistent redis cache
-
-The following environment variables provide an example for specifying a cache, stored in redis, that is automatically
-updated whenever a flag is changed.
-
-```
-CACHE_ENVIRONMENT_DOCUMENT_MODE: "PERSISTENT"
-CACHE_ENVIRONMENT_DOCUMENT_BACKEND: "django_redis.cache.RedisCache"
-CACHE_ENVIRONMENT_DOCUMENT_LOCATION: "redis://127.0.0.1:6379/1"
-CACHE_ENVIRONMENT_DOCUMENT_OPTIONS: "{\"PASSWORD\": \"myredispassword\"}"
-```
-
-## Unified Front End and Back End Build
-
-You can run Flagsmith as a single application/docker container using our unified builds. These are available on
-[Docker Hub](https://hub.docker.com/repository/docker/flagsmith/flagsmith) but you can also run the front end as part of
-the Django Application. Steps to do this:
-
-```bash
-# Update packages and build django.
-cd frontend
-npm install
-npm run bundledjango
-
-# Copy additional assets with Django
-cd ../api
-python manage.py collectstatic
-
-# Boot the server
-python manage.py runserver
-```
-
-### How it works
-
-Webpack compiles a front end build, sourcing `api/app/templates/index.html`. It places the compiled JS and CSS assets to
-`api/static` then copies the annotated `index.html` page to `api/app/templates/webpack/index.html`.
-
-The Django `collectstatic` command then copies all the additional static assets that Django needs, including
-`api/app/templates/webpack/index.html`, into `api/static`.
-
-## Rolling back to a previous version of Flagsmith
-
-:::warning
-
-These steps may result in data loss in the scenario where new models or fields have been added to the database. We
-recommend taking a full backup of the database before completing the rollback.
-
-:::
-
-If you need to roll back to a previous version of Flagsmith you will need to ensure that the database is also rolled
-back to the correct state. In order to do this, you will need to unapply all the migrations that happened in between the
-version that you want to roll back to, and the one that you are rolling back from. The following steps explain how to do
-that.
-
-1. Identify the date and time that you deployed the version that you want to roll back to.
-
-:::tip
-
-If you are unsure on when you completed the previous deployment, then you can use the `django_migrations` table as a
-guide. If you query the table, using the following query then you should see the migrations that have been applied (in
-descending order), grouped in batches corresponding to each deployment.
-
-```sql
-SELECT *
-FROM django_migrations
-ORDER BY applied DESC
-```
-
-:::
-
-2. Run the following command inside a Flagsmith API container running the _current_ version of Flagsmith
-
-```bash
-python manage.py rollbackmigrationsafter "getTrait(key:string)=> string|number|boolean | Once used with an identified user you can get the value of any trait that is set for them e.g. `flagsmith.getTrait("accepted_cookie_policy")` |
| getAllTraits()=> Record<string,string|number|boolean> | Once used with an identified user you can get a key value pair of all traits that are set for them e.g. `flagsmith.getTraits()` |
| getState()=>IState | Retrieves the current state of flagsmith, useful in NextJS / isomorphic applications. `flagsmith.getState()` |
-| setState(state: IState)=>void | Set the current state of flagsmith, [useful in NextJS / isomorphic applications.](/clients/next-ssr#comparing-ssr-and-client-side-flagsmith-usage) e.g. `flagsmith.setState({identity: 'mary@mycompany.com'})`. |
+| setState(state: IState)=>void | Set the current state of flagsmith, [useful in NextJS / isomorphic applications.](/integrating-with-flagsmith/sdks/client-side-sdks/nextjs-and-ssr) e.g. `flagsmith.setState({identity: 'mary@mycompany.com'})`. |
| setTrait(key:string, value:string|number|boolean)=> Promise<IFlags> | Once used with an identified user you can set the value of any trait relevant to them e.g. `flagsmith.setTrait("accepted_cookie_policy", true)` |
| setTraits(values:Record\)=\> Promise<IFlags> | Set multiple traits e.g. `flagsmith.setTraits({foo:"bar",numericProp:1,boolProp:true})`. Setting a value of null for a trait will remove that trait. |
| incrementTrait(key:string, value:number)=> Promise<IFlags> | You can also increment/decrement a particular trait them e.g. `flagsmith.incrementTrait("click_count", 1)` |
diff --git a/docs/docs/clients/client-side/nextjs-and-ssr.md b/docs/docs/integrating-with-flagsmith/sdks/client-side-sdks/nextjs-and-ssr.md
similarity index 91%
rename from docs/docs/clients/client-side/nextjs-and-ssr.md
rename to docs/docs/integrating-with-flagsmith/sdks/client-side-sdks/nextjs-and-ssr.md
index cb17580c0917..b096cfeb8e02 100644
--- a/docs/docs/clients/client-side/nextjs-and-ssr.md
+++ b/docs/docs/integrating-with-flagsmith/sdks/client-side-sdks/nextjs-and-ssr.md
@@ -2,7 +2,6 @@
title: Flagsmith React SDK
sidebar_label: Next.js and SSR
description: Manage your Feature Flags and Remote Config with NextJS and SSR.
-slug: /clients/next-ssr
---
The JavaScript Library contains a bundled isomorphic library, allowing you to fetch flags in the server and hydrate your
@@ -34,15 +33,15 @@ settings page.
## Comparing SSR and client-side Flagsmith usage
-The SDK is initialised and used in the same way as the [JavaScript](/clients/javascript) and [React](/clients/react)
+The SDK is initialised and used in the same way as the [JavaScript](/integrating-with-flagsmith/sdks/client-side-sdks/javascript) and [React](/integrating-with-flagsmith/sdks/client-side-sdks/react)
SDK. The main difference is that Flagsmith should be imported from `flagsmith/isomorphic`.
The main flow with Next.js and any JavaScript-based SSR can be as follows:
1. Fetch the flags on the server, optionally passing an identity to
- [`flagsmith.init({})`](/clients/javascript#initialisation-options)
-2. Pass the resulting state to the client with [`flagsmith.getState()`](/clients/javascript#available-functions)
-3. Initialise flagsmith on the client with [`flagsmith.setState(state)`](/clients/javascript#available-functions)
+ [`flagsmith.init({})`](/integrating-with-flagsmith/sdks/client-side-sdks/javascript#initialisation-options)
+2. Pass the resulting state to the client with [`flagsmith.getState()`](/integrating-with-flagsmith/sdks/client-side-sdks/javascript#available-functions)
+3. Initialise flagsmith on the client with [`flagsmith.setState(state)`](/integrating-with-flagsmith/sdks/client-side-sdks/javascript#available-functions)
### Example: Initialising the SDK with Next.js
@@ -154,7 +153,7 @@ export function MyComponent() {
}
```
-From this point on, the SDK usage is the same as the [React SDK Guide](/clients/react)
+From this point on, the SDK usage is the same as the [React SDK Guide](/integrating-with-flagsmith/sdks/client-side-sdks/react)
### Example: Flagsmith with Next.js middleware
@@ -223,4 +222,4 @@ Step 3: Optionally force the client to fetch a fresh set of flags
flagsmith.getFlags();
```
-From that point the SDK usage is the same as the [JavaScript SDK Guide](/clients/javascript)
+From that point the SDK usage is the same as the [JavaScript SDK Guide](/integrating-with-flagsmith/sdks/client-side-sdks/javascript)
diff --git a/docs/docs/clients/client-side/react.md b/docs/docs/integrating-with-flagsmith/sdks/client-side-sdks/react.md
similarity index 92%
rename from docs/docs/clients/client-side/react.md
rename to docs/docs/integrating-with-flagsmith/sdks/client-side-sdks/react.md
index 8238e835c8fd..10a73d0e7139 100644
--- a/docs/docs/clients/client-side/react.md
+++ b/docs/docs/integrating-with-flagsmith/sdks/client-side-sdks/react.md
@@ -2,7 +2,6 @@
title: Flagsmith React SDK
sidebar_label: React and React Native
description: Manage your Feature Flags and Remote Config with React and React Native Hooks.
-slug: /clients/react
---
This library includes React/React Native Hooks allowing you to query individual features and flags that limit
@@ -28,7 +27,7 @@ npm i flagsmith --save
The React Native SDK shares the exact same implementation of Flagsmith, however, requires an implementation of
AsyncStorage to be provided (e.g. @react-native-community/async-storage) in order to utilise analytics and caching. See
-[here](/clients/javascript#initialisation-options).
+[here](/integrating-with-flagsmith/sdks/client-side-sdks/javascript#initialisation-options).
:::
@@ -60,12 +59,12 @@ export function AppRoot() {
```
Providing options to the Flagsmith provider will initialise the client, the API reference for these options can be found
-[here](/clients/javascript#initialisation-options).
+[here](/integrating-with-flagsmith/sdks/client-side-sdks/javascript#initialisation-options).
:::tip Initialising before rendering the FlagsmithProvider
If you wish to initialise the Flagsmith client before React rendering (e.g. in redux, or SSR) you can do so by calling
-[flagsmith.init](/clients/javascript#example-initialising-the-sdk) and provide no options property to the
+[flagsmith.init](/integrating-with-flagsmith/sdks/client-side-sdks/javascript#example-initialising-the-sdk) and provide no options property to the
FlagsmithProvider component.
:::
@@ -104,7 +103,7 @@ You can find the exact definitions of these types
| ------------------------ | :------------------------------------------------------------------------------------------------------------: | -------: | ------------: |
| `flagsmith: IFlagsmith` | Defines the flagsmith instance that the provider will use. | **YES** | null |
| `options?: ` IInitConfig | Initialisation options to use. If you don't provide this you will have to call flagsmith.init elsewhere. | | null |
-| `serverState?: IState` | Used to pass an initial state, in most cases as a result of SSR flagsmith.getState(). See [Next.js and SSR](/) | | null |
+| `serverState?: IState` | Used to pass an initial state, in most cases as a result of SSR flagsmith.getState(). See [Next.js and SSR](/integrating-with-flagsmith/sdks/client-side-sdks/nextjs-and-ssr) | | null |
### Step 3: Using useFlagsmith to access the Flagsmith instance
diff --git a/docs/docs/clients/index.md b/docs/docs/integrating-with-flagsmith/sdks/index.md
similarity index 86%
rename from docs/docs/clients/index.md
rename to docs/docs/integrating-with-flagsmith/sdks/index.md
index bd5f5877216c..7cc38276a2b4 100644
--- a/docs/docs/clients/index.md
+++ b/docs/docs/integrating-with-flagsmith/sdks/index.md
@@ -1,11 +1,12 @@
---
description: Manage your Feature Flags and Remote Config in your REST APIs.
sidebar_position: 1
+sidebar_label: SDKs
---
# SDKs Overview
-Flagsmith ships with SDKs for a bunch of different programming languages. We also have a [REST API](rest.md) that you
+Flagsmith ships with SDKs for a bunch of different programming languages. We also have a [REST API](/integrating-with-flagsmith/flagsmith-api-overview) that you
can use if you want to consume the API directly.
Our SDKs are split into two different groups. These SDKs have different methods of operation due to the differences in
@@ -26,28 +27,28 @@ depending on the SDK you are using.
Client-side SDKs run in web browsers or on mobile devices. These runtimes execute within _untrusted environments_.
Anyone using the Javascript SDK in a web browser, for example, can find the Client-side SDK, create a new Identity, look
at their flags and
-[potentially write Traits to the Identity](/system-administration/security#preventing-client-sdks-from-setting-traits).
+[potentially write Traits to the Identity](/administration-and-security/governance-and-compliance/security#preventing-client-sdks-from-setting-traits).
Client-side SDKs are also limited to the
-[types of data that they have access to](/guides-and-examples/integration-approaches#segment-and-targeting-rules-are-not-leaked-to-the-client).
+[types of data that they have access to](/best-practices/integration-approaches#segment-and-targeting-rules-are-not-leaked-to-the-client).
Client-side Environment keys are designed to be shared publicly, for example in your HTML/JS code that is sent to a web
browser.
-Client-side SDKs hit our [Edge API](../advanced-use/edge-api.md) directly to retrieve their flags.
+Client-side SDKs hit our [Edge API](/deployment-self-hosting/edge-proxy) directly to retrieve their flags.
Read more about our Client-side SDKs for your language/platform:
-- [Javascript](/clients/javascript)
-- [Android/Kotlin](/clients/android)
-- [Flutter](/clients/flutter)
-- [iOS/Swift](/clients/ios)
-- [React & React Native](/clients/react)
-- [Next.js, Svelte and SSR](/clients/next-ssr)
+- [Javascript](/integrating-with-flagsmith/sdks/client-side-sdks/javascript)
+- [Android/Kotlin](/integrating-with-flagsmith/sdks/client-side-sdks/android)
+- [iOS/Swift](/integrating-with-flagsmith/sdks/client-side-sdks/ios)
+- [React](/integrating-with-flagsmith/sdks/client-side-sdks/react)
+- [Next.js and SSR](/integrating-with-flagsmith/sdks/client-side-sdks/nextjs-and-ssr)
+- [Flutter](/integrating-with-flagsmith/sdks/client-side-sdks/flutter)
## Server-side SDKs
-[Server-side SDKs](/clients/server-side) run within _trusted environments_ - typically the server infrastructure that
+[Server-side SDKs](/integrating-with-flagsmith/sdks/server-side) run within _trusted environments_ - typically the server infrastructure that
you have control over. Because of this, you should not share your Server-side Environment keys publicly; they should be
treated as secret.
@@ -82,7 +83,7 @@ the Flag Engine, and the engine runs within your server environment within the F

You have to configure the SDK to run in Local Evaluation mode. See the
-[SDK configuration options](/clients/server-side#configuring-the-sdk) for details on how to do that in your particular language.
+[SDK configuration options](/integrating-with-flagsmith/sdks/server-side#configuring-the-sdk) for details on how to do that in your particular language.
When the SDK is initialised in Local Evaluation mode, it grabs the entire set of details about the Environment from the
Flagsmith API. For a given Environment, this includes:
@@ -96,7 +97,7 @@ within your server infrastructure.
:::info
-**[Edge API](advanced-use/edge-api.md) only**: When using identity overrides in local evaluation:
+**[Edge API](/deployment-self-hosting/edge-proxy) only**: When using identity overrides in local evaluation:
- Keep overrides count under 500.
- Make sure your environment settings enable it.
@@ -162,7 +163,7 @@ for the relevant language platform for details.
network request.
If this approach does not work for you (generally for reasons of latency or overly chatty networking) you should
-consider Local Evaluation mode (explained below) or the [Edge Proxy](/advanced-use/edge-proxy).
+consider Local Evaluation mode (explained below) or the [Edge Proxy](/deployment-self-hosting/edge-proxy).
### Local Evaluation Network Model
@@ -298,7 +299,7 @@ situations:
- If you want to work with Flagsmith programatically, for example when creating and deleting Environments as part of a
CI/CD process.
-- When using the [Terraform Provider](/integrations/terraform).
+- When using the [Terraform Provider](/third-party-integrations/ci-cd/terraform).
These keys are secret and should not be shared.
@@ -340,7 +341,7 @@ When running in Local Evaluation mode, our SDKs expect to be run as long-lived p
Lambda either break this contract or make it much more complicated. As a result, we do not recommend running our SDKs in
Local Evaluation mode on top of platforms like Lambda where you do not have complete control over process lifetimes.
-Our [Edge Proxy](/advanced-use/edge-proxy/) is a good candidate if you need to run local evaluation mode alongside
+Our [Edge Proxy](/deployment-self-hosting/edge-proxy) is a good candidate if you need to run local evaluation mode alongside
serverless platforms.
:::
@@ -353,10 +354,10 @@ are all computed locally.
- Identities and their Traits are **not** read from or written to the Flagsmith API, and so are not persisted in the
datastore. This means that you have to provide the full complement of Traits when requesting the Flags for a
particular Identity. Our SDKs all provide relevant methods to achieve this.
-- [Analytics-based Integrations](/integrations#analytics-platforms) do not run.
- [Flag Analytics](/advanced-use/flag-analytics) do still work, if enabled within the
- [SDK setup](/clients/server-side#configuring-the-sdk).
-- **[Edge API](advanced-use/edge-api.md) only**: Currently, Flagsmith SDKs support up to ~500 identity overrides, depending on flag value sizes and segment count, when used with
+- [Analytics-based Integrations](/third-party-integrations#analytics-platforms) do not run.
+- [Flag Analytics](/managing-flags/flag-analytics) do still work, if enabled within the
+ [SDK setup](/integrating-with-flagsmith/sdks/server-side#configuring-the-sdk).
+- **[Edge API](/deployment-self-hosting/edge-proxy) only**: Currently, Flagsmith SDKs support up to ~500 identity overrides, depending on flag value sizes and segment count, when used with
Edge API. If you store more than 1MB of environment document data, you will need to query the Edge API endpoint directly and use
pagination:
diff --git a/docs/docs/clients/server-side.mdx b/docs/docs/integrating-with-flagsmith/sdks/server-side.mdx
similarity index 97%
rename from docs/docs/clients/server-side.mdx
rename to docs/docs/integrating-with-flagsmith/sdks/server-side.mdx
index f5c6f3c1d2d7..a70cb49c3f62 100644
--- a/docs/docs/clients/server-side.mdx
+++ b/docs/docs/integrating-with-flagsmith/sdks/server-side.mdx
@@ -1,7 +1,7 @@
---
description: Manage your Feature Flags and Remote Config in your Server Side Applications.
sidebar_label: Server Side
-sidebar_position: 2
+sidebar_position: 30
---
import CodeBlock from '@theme/CodeBlock';
@@ -21,7 +21,7 @@ import {
:::tip
Server Side SDKs can run in 2 different modes: Local Evaluation and Remote Evaluation. We recommend
-[reading up about the differences](/clients#server-side-sdks) first before integrating the SDKS into your applications.
+[reading up about the differences](/integrating-with-flagsmith/integration-overview) first before integrating the SDKS into your applications.
:::
@@ -574,25 +574,25 @@ secret_button_feature_value = Flagsmith.Client.get_feature_value(flags, "secret_



Analytics and product insight platform
+User behaviour analytics and tracking
+Customer data platform for seamless data flow
+Automatic user behaviour tracking
+Enterprise analytics and marketing automation
+Customer data pipeline and privacy-focused analytics
+Cloud monitoring and observability platform
+Application performance monitoring
+Open-source monitoring and analytics
+Enterprise application performance monitoring
+Automatic observability and AIOps
+Error monitoring and crash reporting
+Issue tracking and project management
+Version control and development collaboration
+Team communication and notifications
+IT service management and automation
+Infrastructure as code automation
+Get started with continuous integration and deployment
+Send HTTP notifications when flags change
+{description}
+ Learn more → +