mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
WIP: Feat/quickstart oss (#912)
* feat: preliminary outline * feat: add more sections to quickstart * fix: update link to unique architecture * fix: update description * fix: update docs * feat: add curl option * fix: update link * fix: rename proxy menu item * fix: remove trailing slashes * fix: docs * fix: heroku casing * fix: add enterprise casing * fix: DO casing * fix: update link to getunleash.io * fix: add curl command * fix: config * fix: update docs
This commit is contained in:
parent
0c62809d9f
commit
00285aafb8
@ -7,7 +7,7 @@ title: Feature Toggle Types
|
||||
|
||||
Starting with version `3.5.0` Unleash introduces the concept of feature toggle types. The toggle types are heavily inspired by [Pete Hodgson's article on feature toggles](https://martinfowler.com/articles/feature-toggles.html).
|
||||
|
||||
The idea is to make it easier for teams to manage their feature toggles, if they can more clearly classify them. The classification will also help us understand the [expected feature toggle lifetime](https://www.unleash-hosted.com/articles/feature-toggle-life-time-best-practices). Some feature toggles are meant to live for a few weeks, while we work on the new functionality, while others are of a more permanent nature.
|
||||
The idea is to make it easier for teams to manage their feature toggles, if they can more clearly classify them. The classification will also help us understand the [expected feature toggle lifetime](https://www.getunleash.io/blog/feature-toggle-life-time-best-practices). Some feature toggles are meant to live for a few weeks, while we work on the new functionality, while others are of a more permanent nature.
|
||||
|
||||
Feature toggle types currently supported by Unleash:
|
||||
|
||||
|
@ -55,7 +55,7 @@ else
|
||||
|
||||
Pleas note the client SDK will synchronize with the Unleash-hosted API on initialization, and thus it can take a few milliseconds the first time before the client has the correct state. You can use the _SynchronousInitialization_ option to block the client until it has successfully synced with the server.
|
||||
|
||||
Read more about the [Unleash architecture](https://www.unleash-hosted.com/articles/our-unique-architecture) to learn how it works in more details
|
||||
Read more about the [Unleash architecture](https://www.getunleash.io/blog/our-unique-architecture) to learn how it works in more details
|
||||
|
||||
## Step 4: Provide Unleash Context {#step-4-provide-unleash-context}
|
||||
|
||||
|
92
websitev2/docs/sdks/proxy-react.md
Normal file
92
websitev2/docs/sdks/proxy-react.md
Normal file
@ -0,0 +1,92 @@
|
||||
---
|
||||
id: proxy-react
|
||||
title: React proxy SDK
|
||||
---
|
||||
|
||||
> This library is meant to be used with the [unleash-proxy](https://github.com/Unleash/unleash-proxy). The proxy application layer will sit between your unleash instance and your client applications, and provides performance and security benefits. DO NOT TRY to connect this library directly to the unleash instance, as the datasets follow different formats because the proxy only returns evaluated toggle information.
|
||||
|
||||
# Installation
|
||||
|
||||
```
|
||||
npm install @unleash/proxy-client-react
|
||||
// or
|
||||
yarn add @unleash/proxy-client-react
|
||||
```
|
||||
|
||||
Import the provider like this in your entrypoint file (typically index.js/ts):
|
||||
|
||||
```
|
||||
import FlagProvider from '@unleash/proxy-client-react';
|
||||
|
||||
const config = {
|
||||
url: 'https://HOSTNAME/api/proxy',
|
||||
clientKey: 'PROXYKEY',
|
||||
refreshInterval: 15,
|
||||
appName: 'your-app-name',
|
||||
environment: 'dev',
|
||||
};
|
||||
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
<FlagProvider config={config}>
|
||||
<App />
|
||||
</FlagProvider>
|
||||
</React.StrictMode>,
|
||||
document.getElementById('root')
|
||||
);
|
||||
```
|
||||
|
||||
To check if a feature is enabled:
|
||||
|
||||
```
|
||||
import { useFlag } from '@unleash/proxy-client-react';
|
||||
|
||||
const TestComponent = () => {
|
||||
const enabled = useFlag('travel.landing');
|
||||
|
||||
if (enabled) {
|
||||
return <SomeComponent />
|
||||
}
|
||||
return <AnotherComponent />
|
||||
};
|
||||
|
||||
export default TestComponent;
|
||||
```
|
||||
|
||||
To check variants:
|
||||
|
||||
```
|
||||
import { useVariant } from '@unleash/proxy-client-react';
|
||||
|
||||
const TestComponent = () => {
|
||||
const variant = useVariant('travel.landing');
|
||||
|
||||
if (variant.enabled && variant.name === "SomeComponent") {
|
||||
return <SomeComponent />
|
||||
} else if (variant.enabled && variant.name === "AnotherComponent") {
|
||||
return <AnotherComponent />
|
||||
}
|
||||
return <DefaultComponent />
|
||||
};
|
||||
|
||||
export default TestComponent;
|
||||
```
|
||||
|
||||
## Updating context
|
||||
|
||||
Follow the following steps in order to update the unleash context:
|
||||
|
||||
```
|
||||
import { useUnleashContext, useFlag } from '@unleash/proxy-client-react'
|
||||
|
||||
const MyComponent = ({ userId }) => {
|
||||
const variant = useFlag("my-toggle");
|
||||
const updateContext = useUnleashContext();
|
||||
|
||||
useEffect(() => {
|
||||
// context is updated with userId
|
||||
updateContext({ userId })
|
||||
}, [])
|
||||
}
|
||||
|
||||
```
|
@ -7,7 +7,7 @@ It is powerful to be able to turn a feature on and off instantaneously, without
|
||||
|
||||
The definition of an activation strategy lives in the Unleash API and can be created via the Unleash UI. The implementation of activation strategies lives in various client implementations.
|
||||
|
||||
Unleash comes with a few common activation strategies. Some of them require the client to provide the [unleash-context](./unleash-context.md), which gives the necessary context for Unleash.
|
||||
Unleash comes with a few common activation strategies. Some of them require the client to provide the [unleash-context](unleash-context.md), which gives the necessary context for Unleash.
|
||||
|
||||
## Standard {#standard}
|
||||
|
||||
|
@ -45,4 +45,4 @@ In the example above we have to configure two activation strategies, **userWithI
|
||||
|
||||
You use activation strategies to control who the feature toggle will be enabled for. You can configure multiple strategies for a feature toggle, and they are considered in an OR fashion, meaning if one of them evaluates to true the toggle will be enabled.
|
||||
|
||||
If you need to limit the exposure (AND) you should look in to [strategy constraints](/advanced/strategy_constraints), which is the building block for that.
|
||||
If you need to limit the exposure (AND) you should look in to [strategy constraints](advanced/strategy-constraints.md), which is the building block for that.
|
||||
|
40
websitev2/docs/user_guide/important-concepts.md
Normal file
40
websitev2/docs/user_guide/important-concepts.md
Normal file
@ -0,0 +1,40 @@
|
||||
---
|
||||
id: important-concepts
|
||||
title: Important Concepts
|
||||
---
|
||||
|
||||
There are some concepts it's important to understand in order to work effectively with Unleash:
|
||||
|
||||
## Activation strategies
|
||||
|
||||
Feature toggles can have multiple activation strategies. An activation strategy will only run when a feature toggle is enabled and provides a way to control WHO will get access to the feature.
|
||||
|
||||
Activation strategies compound, and every single strategy will be evaluated. If any one of them returns true, the user will receive access to the feature.
|
||||
|
||||
> Unless you add activation strategies on toggle creation, the toggle will be created with the default strategy. The default strategy says that the toggle is either 100% off or 100% on for all users. This means that any other strategies you add will have no effect. If you want to use strategies to control rollout you need to remove the default strategy.
|
||||
|
||||
Unleash comes with a set of built in strategies. [But you can also build your own custom strategies.](../advanced/custom_activation_strategy)
|
||||
|
||||
[You can read more about activation strategies here.](./activation_strategy)
|
||||
|
||||
## Local evaluation
|
||||
|
||||
All our SDKs perform local evaluation of feature toggles, which means that they download the configuration from unleash and cache the configuration in memory in your application. This is done in order to avoid adding network latency to user interactions, making it unnoticable for users that you are using feature flagging, in addition to the added benefit that none of your data leaves your application - enforcing privacy by design.
|
||||
|
||||
[Read more about our unique architecture here](https://www.getunleash.io/blog/our-unique-architecture)
|
||||
|
||||
## Unleash Context
|
||||
|
||||
Since the SDKs perform local evaluation, some of the parameters needed for evaluation must be supplied through the Unleash Context. The unleash context allows you to pass in userIds, sessionIds or other relevant information that is needed in order to perform the evaluation. If, for example, you want to enable a feature for a set of specific userIds, you would need to provide the current userId in the unleash context in order for the evaluation to enable the feature.
|
||||
|
||||
[You can read more about the unleash context here.](./unleash_context)
|
||||
|
||||
## API architecture
|
||||
|
||||
The Unleash API is split into two. One API is for the clients connecting unleash and is located under the path /api/client, and provides access to retrieving saved feature toggle configurations, metrics and registering the application.
|
||||
|
||||
The second API is the admin API, which is utilised in order to control any CRUD aspect of unleash resources. The split ensures a second layer of security that ensures that in the case you should loose your client api key, attackers will only have read-only access to your feature toggle configurations.
|
||||
|
||||
This ensures that we can have different data responses for the client API endpoints which will include less metadata, and be cached more heavily - optimising the SDK endpoints for best performance.
|
||||
|
||||
[Read more about unleash API here](../api)
|
@ -9,7 +9,7 @@ Welcome to the Unleash documentation. Our goal with our documentation is to guid
|
||||
|
||||
One of the most important aspects of the architecture to understand is that feature toggles _are evaluated in a client SDKs_ which runs as part of your application. This makes toggle evaluations super-fast (_we talk nano-seconds_), scalable and resilient against network disturbances. In order to achieve this Unleash compromises a small update-delay when you change your toggle configurations until it is fully propagated to your application (in terms of seconds and is configurable).
|
||||
|
||||
If you want more details you cam read about [our unique architecture](https://www.unleash-hosted.com/articles/our-unique-architecture).
|
||||
If you want more details you can read about [our unique architecture](https://www.getunleash.io/blog/our-unique-architecture).
|
||||
|
||||
### Unleash Server {#unleash-server}
|
||||
|
||||
@ -21,15 +21,15 @@ Before you can connect your application to Unleash you need a Unleash server. Yo
|
||||
- [Click-to-deploy on Heroku](https://www.heroku.com/deploy/?template=https://github.com/Unleash/unleash)
|
||||
2. **Unleash Enterprise**
|
||||
- [Hosted Plans](https://www.getunleash.io/plans)
|
||||
- [Self-hosted](https://www.unleash-hosted.com/articles/self-host-your-feature-toggle-system/)
|
||||
- [Self-hosted](https://www.getunleash.io/blog/self-host-your-feature-toggle-system)
|
||||
|
||||
### System Overview {#system-overview}
|
||||
|
||||
![system_overview](/img/Unleash_architecture.svg 'System Overview')
|
||||
|
||||
- **Unleash API** - The service holding all feature toggles and their configurations. Configurations declare which activation strategies to use and which parameters they should get. [API documentation](/api)
|
||||
- **Unleash Admin UI** - The dashboard used to manage feature toggles, define new strategies, look at metrics, etc. [Create your first feature toggle](./user_guide/create_feature_toggle)
|
||||
- **Unleash SDK** - Used by clients to check if a feature is enabled or disabled. The SDK also collects metrics and sends them to the Unleash API. [See all our SDKs](/sdks)
|
||||
- **Unleash Proxy** - Sits between frontend/native applications and the Unleash API. Ensures high performance and that you don't expose the full feature toggle configuration to end-users. [Read more about Unleash Proxy](/sdks/unleash-proxy)
|
||||
- **Unleash Admin UI** - The dashboard used to manage feature toggles, define new strategies, look at metrics, etc. [Create your first feature toggle](user_guide/create-feature-toggle.md)
|
||||
- **Unleash SDK** - Used by clients to check if a feature is enabled or disabled. The SDK also collects metrics and sends them to the Unleash API. [See all our SDKs](sdks/index.md)
|
||||
- **Unleash Proxy** - Sits between frontend/native applications and the Unleash API. Ensures high performance and that you don't expose the full feature toggle configuration to end-users. [Read more about Unleash Proxy](sdks/unleash-proxy.md)
|
||||
|
||||
To be super fast (_we talk nano-seconds_), the [client SDK](/sdks/index) caches all feature toggles and their current configuration in memory. The activation strategies are also implemented in the SDK. This makes it really fast to check if a toggle is on or off because it is just a simple function operating on local state, without the need to poll data from the database.
|
||||
To be super fast (_we talk nano-seconds_), the [client SDK](sdks/index.md) caches all feature toggles and their current configuration in memory. The activation strategies are also implemented in the SDK. This makes it really fast to check if a toggle is on or off because it is just a simple function operating on local state, without the need to poll data from the database.
|
||||
|
291
websitev2/docs/user_guide/quickstart.md
Normal file
291
websitev2/docs/user_guide/quickstart.md
Normal file
@ -0,0 +1,291 @@
|
||||
---
|
||||
id: quickstart
|
||||
title: Quickstart
|
||||
---
|
||||
|
||||
In this section we will attempt to guide you in order to get started with Unleash easily. There are multiple options to get started with Unleash, browse the headings to find the method that works best for you.
|
||||
|
||||
## I just want to get started creating toggles without much setup
|
||||
|
||||
Usually, you'll need to set up an Unleash instance in order to work with Unleash. However, for testing purposes we have set up a demo instance that you can use in order to test out different use-cases before setting up your own instance. You can find the demo instance admin panel here: https://app.unleash-hosted.com/demo/
|
||||
|
||||
NOTE: This is a demo instance set up with the Enterprise version. Some of the functionality may be enterprise specific, but everything we cover here is also available in open source.
|
||||
|
||||
### I want to test toggles in a client side environment
|
||||
|
||||
In order to use feature toggles on the client side you need to connect through [the Unleash proxy](sdks/unleash-proxy.md). The Unleash proxy will provide a security and performance layer between your client application and the Unleash instance. For now, you can use the proxy we have set up on the demo instance.
|
||||
|
||||
#### Create your first toggle
|
||||
|
||||
In order to create a toggle through the UI, [you can follow this guide](create-feature-toggle.md). Once you have created your feature toggle, you are ready to connect your application using an SDK.
|
||||
|
||||
#### Connecting to the Unleash proxy from your app
|
||||
|
||||
Connection details:
|
||||
|
||||
```
|
||||
Api URL: https://app.unleash-hosted.com/demo/proxy
|
||||
Secret key: proxy-123 (edited)
|
||||
```
|
||||
|
||||
Now you can open your application code and connect through one of the proxy SDKs:
|
||||
|
||||
- [Javascript Proxy SDK](sdks/proxy-javascript.md)
|
||||
- [iOS Proxy SDK](sdks/proxy-ios.md)
|
||||
- [Android Proxy SDK](sdks/android-proxy.md)
|
||||
- [React](sdks/proxy-react.md)
|
||||
|
||||
Here is a connection example using the javascript proxy SDK:
|
||||
|
||||
```javascript
|
||||
import { UnleashClient } from 'unleash-proxy-client';
|
||||
|
||||
const unleash = new UnleashClient({
|
||||
url: 'https://app.unleash-hosted.com/demo/proxy',
|
||||
clientKey: 'proxy-123',
|
||||
appName: 'my-webapp',
|
||||
});
|
||||
|
||||
// Used to set the context fields, shared with the Unleash Proxy
|
||||
unleash.updateContext({ userId: '1233' });
|
||||
|
||||
// Start the background polling
|
||||
unleash.start();
|
||||
|
||||
if (unleash.isEnabled('proxy.demo')) {
|
||||
// do something
|
||||
}
|
||||
```
|
||||
|
||||
Now you are ready to use the feature toggle you created in your client side application, using the appropriate proxy SDK.
|
||||
|
||||
### I want to test toggles in a backend environment
|
||||
|
||||
#### Create your first toggle
|
||||
|
||||
In order to create a toggle through the UI, [you can follow this guide](create-feature-toggle.md). Once you have created your feature toggle, you are ready to connect your application using an SDK.
|
||||
|
||||
#### Connecting to the Unleash instance from your app
|
||||
|
||||
Connection details:
|
||||
|
||||
```
|
||||
Api URL: https://app.unleash-hosted.com/demo/api/
|
||||
Secret key: 56907a2fa53c1d16101d509a10b78e36190b0f918d9f122d
|
||||
```
|
||||
|
||||
Curl command test credentials and retrieve feature toggles:
|
||||
|
||||
```
|
||||
curl https://app.unleash-hosted.com/demo/api/client/features \
|
||||
-H "Authorization: 56907a2fa53c1d16101d509a10b78e36190b0f918d9f122d";
|
||||
```
|
||||
|
||||
Now you can open up your application code and create a connection to Unleash using one of our [SDKs](sdks/index.md). Here's an example using the NodeJS SDK:
|
||||
|
||||
```javascript
|
||||
const { initialize } = require('unleash-client');
|
||||
const unleash = initialize({
|
||||
url: 'https://app.unleash-hosted.com/demo/api/',
|
||||
appName: 'my-app-name',
|
||||
instanceId: 'my-unique-instance-id',
|
||||
customHeaders: {
|
||||
Authorization: '56907a2fa53c1d16101d509a10b78e36190b0f918d9f122d',
|
||||
},
|
||||
});
|
||||
|
||||
unleash.on('synchronized', () => {
|
||||
// Unleash is ready to serve updated feature toggles.
|
||||
|
||||
// Check a feature flag
|
||||
const isEnabled = unleash.isEnabled('some-toggle');
|
||||
|
||||
// Check the variant
|
||||
const variant = unleash.getVariant('app.ToggleY');
|
||||
});
|
||||
```
|
||||
|
||||
Now you can fetch the feature toggle you created and try turning it on / off in your code.
|
||||
|
||||
## I want to setup my own instance for testing purposes
|
||||
|
||||
If you want to set up your own instance for testing purposes you can easily do so by using one of our premade setup kits for Heroku or DigitalOcean.
|
||||
|
||||
> The Heroku instance setup is FREE, and includes a DB to save your state but it will eventually go to sleep when not used. The DigitalOcean setup utilises droplets and will cost you around 10$/month to run, but in turn it will not go to sleep. NOTE: If you use the DigitalOcean link below and are a new user, you will receive 100$ in FREE credits.
|
||||
|
||||
### Deploy a free version of Unleash to Heroku
|
||||
|
||||
[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.png)](https://www.heroku.com/deploy/?template=https://github.com/Unleash/unleash)
|
||||
|
||||
### Deploy a paid version of Unleash to DigitalOcean
|
||||
|
||||
> You'll receive 100\$ in free credits if you are a new DigitalOcean user using this link.
|
||||
|
||||
[![Deploy to DigitalOcean](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/Unleash/unleash/tree/master&refcode=0e1d75187044)
|
||||
|
||||
### Accessing your new instance
|
||||
|
||||
Once you have set up the new instance, click the URL provided by either Heroku or DigitalOcean and you'll be taken to the application login screen.
|
||||
|
||||
Input the following credentials to log in:
|
||||
|
||||
```
|
||||
username: admin
|
||||
password: unleash4all
|
||||
```
|
||||
|
||||
### Create your first toggle
|
||||
|
||||
In order to create a toggle through the UI, [you can follow this guide](create-feature-toggle.md). Once you have created your feature toggle, you are ready to connect your application using an SDK.
|
||||
|
||||
If you'd like to create your feature toggles with code, you can hit the create feature endpoint with the following command:
|
||||
|
||||
> CRUD operations require an admin API key. For security reasons we have split the admin and client API into separate APIs. You can view how to create API keys in the next section of this guide. Make sure you create client keys for use in SDKs and restrict Admin api key usage.
|
||||
|
||||
```curl
|
||||
curl -H "Content-Type: application/json" \
|
||||
-H "Authorization: MY-ADMIN-API-KEY" \
|
||||
-X POST \
|
||||
-d '{
|
||||
"name": "my-unique-feature-name",
|
||||
"description": "lorem ipsum..",
|
||||
"type": "release",
|
||||
"enabled": false,
|
||||
"stale": false,
|
||||
"strategies": [
|
||||
{
|
||||
"name": "default",
|
||||
"parameters": {}
|
||||
}
|
||||
],
|
||||
"variants": [],
|
||||
"tags": []
|
||||
}' \
|
||||
http://CHANGEME/api/admin/features
|
||||
```
|
||||
|
||||
### Connect your SDK
|
||||
|
||||
Next, find the navigation, open up the Admin panel and find the API Access tab. Click the "Add new api key" button and create a client key. This key can be used to connect to the instance with our [SDKs](sdks/index.md).
|
||||
|
||||
You can find more [information about API keys here](token.md).
|
||||
|
||||
Now that you have your API key created, you have what you need to connect to the SDK (NodeJS example):
|
||||
|
||||
```javascript
|
||||
const { initialize } = require('unleash-client');
|
||||
const unleash = initialize({
|
||||
url: 'https://your.heroku.instance.com/api/',
|
||||
appName: 'my-app-name',
|
||||
instanceId: 'my-unique-instance-id',
|
||||
customHeaders: {
|
||||
Authorization: 'YOUR_API_KEY_HERE',
|
||||
},
|
||||
});
|
||||
|
||||
unleash.on('synchronized', () => {
|
||||
// Unleash is ready to serve updated feature toggles.
|
||||
|
||||
// Check a feature flag
|
||||
const isEnabled = unleash.isEnabled('some-toggle');
|
||||
|
||||
// Check the variant
|
||||
const variant = unleash.getVariant('app.ToggleY');
|
||||
});
|
||||
```
|
||||
|
||||
## I want to run Unleash locally
|
||||
|
||||
### Run Unleash with Docker
|
||||
|
||||
The easiest way to run unleash locally is using [docker](https://www.docker.com/).
|
||||
|
||||
1. Create a network by running `docker network create unleash`
|
||||
2. Start a postgres database:
|
||||
|
||||
```sh
|
||||
docker run -e POSTGRES_PASSWORD=some_password \
|
||||
-e POSTGRES_USER=unleash_user -e POSTGRES_DB=unleash \
|
||||
--network unleash --name postgres postgres
|
||||
```
|
||||
|
||||
3. Start Unleash via docker:
|
||||
|
||||
```sh
|
||||
docker run -p 4242:4242 \
|
||||
-e DATABASE_HOST=postgres -e DATABASE_NAME=unleash \
|
||||
-e DATABASE_USERNAME=unleash_user -e DATABASE_PASSWORD=some_password \
|
||||
-e DATABASE_SSL=false \
|
||||
--network unleash unleashorg/unleash-server
|
||||
```
|
||||
|
||||
[Click here to see all options to get started locally.](deploy/getting-started.md)
|
||||
|
||||
### Accessing your new instance
|
||||
|
||||
Once you have the local instance running on localhost, input the following credentials to log in:
|
||||
|
||||
```
|
||||
username: admin
|
||||
password: unleash4all
|
||||
```
|
||||
|
||||
### Create your first toggle
|
||||
|
||||
In order to create a toggle through the UI, [you can follow this guide](create-feature-toggle.md). Once you have created your feature toggle, you are ready to connect your application using an SDK.
|
||||
|
||||
If you'd like to create your feature toggles with code, you can hit the create feature endpoint with the following command:
|
||||
|
||||
> CRUD operations require an admin API key. For security reasons we have split the admin and client API into separate APIs. You can view how to create API keys in the next section of this guide. Make sure you create client keys for use in SDKs and restrict Admin api key usage.
|
||||
|
||||
```curl
|
||||
curl -H "Content-Type: application/json" \
|
||||
-H "Authorization: MY-ADMIN-API-KEY" \
|
||||
-X POST \
|
||||
-d '{
|
||||
"name": "my-unique-feature-name",
|
||||
"description": "lorem ipsum..",
|
||||
"type": "release",
|
||||
"enabled": false,
|
||||
"stale": false,
|
||||
"strategies": [
|
||||
{
|
||||
"name": "default",
|
||||
"parameters": {}
|
||||
}
|
||||
],
|
||||
"variants": [],
|
||||
"tags": []
|
||||
}' \
|
||||
http://CHANGEME/api/admin/features
|
||||
```
|
||||
|
||||
### Connect your SDK
|
||||
|
||||
Find the navigation, open up the Admin panel and find the API Access tab. Click the "Add new api key" button and create a client key. This key can be used to connect to the instance with our [SDKs](sdks/index.md).
|
||||
|
||||
You can find more [information about API keys here](token.md).
|
||||
|
||||
Now that you have your API key created, you have what you need to connect to the SDK (NodeJS example):
|
||||
|
||||
```javascript
|
||||
const { initialize } = require('unleash-client');
|
||||
const unleash = initialize({
|
||||
url: 'https://localhost:4242/api/',
|
||||
appName: 'my-app-name',
|
||||
instanceId: 'my-unique-instance-id',
|
||||
customHeaders: {
|
||||
Authorization: 'YOUR_API_KEY_HERE',
|
||||
},
|
||||
});
|
||||
|
||||
unleash.on('synchronized', () => {
|
||||
// Unleash is ready to serve updated feature toggles.
|
||||
|
||||
// Check a feature flag
|
||||
const isEnabled = unleash.isEnabled('some-toggle');
|
||||
|
||||
// Check the variant
|
||||
const variant = unleash.getVariant('app.ToggleY');
|
||||
});
|
||||
```
|
@ -25,7 +25,7 @@ All users are able to see tokens with CLIENT level access, but only instance adm
|
||||
|
||||
![Tab Menu](/img/admin_tab_menu.png)
|
||||
|
||||
**3. Click `Add new API key` at the bottom of the page**
|
||||
**3. Click `Add new API key` at the top right of the page**
|
||||
|
||||
**Client keys**
|
||||
|
||||
|
@ -7,7 +7,7 @@ Version 4 of Unleash brings a lot of improvements to Unleash. In this document w
|
||||
|
||||
### Upgrade with ease {#upgrade-with-ease}
|
||||
|
||||
Unleash can either be hosted by us or self-hosted. If you have a managed Unleash Enterprise instance you are automatically upgraded to version 4. If you manage Unleash yourself (either Open-Source or Enterprise Self-hosted) we recommend reading the [migration guide](../deploy/migration_guide).
|
||||
Unleash can either be hosted by us or self-hosted. If you have a managed Unleash Enterprise instance you are automatically upgraded to version 4. If you manage Unleash yourself (either Open-Source or Enterprise Self-hosted) we recommend reading the [migration guide](deploy/migration-guide.md).
|
||||
|
||||
**PS! The first time you access Unleash v4 from a self-hosted instance you will need to login with the default admin user:**
|
||||
|
||||
@ -18,16 +18,16 @@ _(We recommend changing the password of the default user from the admin section.
|
||||
|
||||
### Role-Based Access Control {#role-based-access-control}
|
||||
|
||||
With Role-Based Access Control you can now assign groups to users in order to control access. You can control access to root resources in addition to controlling access to [projects](./projects). _Please be aware that all existing users will become "Owner" of all existing projects as part of the migration from v3 to v4._
|
||||
With Role-Based Access Control you can now assign groups to users in order to control access. You can control access to root resources in addition to controlling access to [projects](projects.md). _Please be aware that all existing users will become "Owner" of all existing projects as part of the migration from v3 to v4._
|
||||
|
||||
[Read more](./rbac)
|
||||
[Read more](rbac.md)
|
||||
|
||||
### New Addons {#new-addons}
|
||||
|
||||
Addons make it easy to integrate Unleash with other systems. In version 4 we bring two new integrations to Unleash:
|
||||
|
||||
- [Microsoft Teams](../addons/teams)
|
||||
- [Datadog](../addons/datadog)
|
||||
- [Datadog](addons/datadog.md)
|
||||
|
||||
### Improved UX {#improved-ux}
|
||||
|
||||
@ -41,14 +41,14 @@ In version 4 we added support for [OpenID Connect](https://openid.net/connect/)
|
||||
|
||||
In version 4 we improved the User Management and made it available for Unleash Open-Source and Unleash Enterprise. Starting in v4 all users accessing Unleash needs to exist in Unleash in order to gain access (because they need to have the proper permission from RBAC.)
|
||||
|
||||
[Read more](./user-management)
|
||||
[Read more](user-management.md)
|
||||
|
||||
### API access {#api-access}
|
||||
|
||||
In version 4 we improved the API Access and made it available for Unleash Open-Source and Unleash Enterprise. Starting from Unleash v4 we require all SDKs to use an access token in order to connect to Unleash.
|
||||
|
||||
[Read more](../advanced/api_access)
|
||||
[Read more](advanced/api_access.md)
|
||||
|
||||
### Custom stickiness {#custom-stickiness}
|
||||
|
||||
In Unleash Enterprise v4 you can configure stickiness when you are doing a gradual rollout with the "flexible rollout" strategy or together with feature toggle variants. This means that you can now have consistent behavior based on any field available on the [Unleash context](./unleash_context).
|
||||
In Unleash Enterprise v4 you can configure stickiness when you are doing a gradual rollout with the "flexible rollout" strategy or together with feature toggle variants. This means that you can now have consistent behavior based on any field available on the [Unleash context](unleash-context.md).
|
||||
|
@ -1,14 +1,15 @@
|
||||
/** @type {import('@docusaurus/types').DocusaurusConfig} */
|
||||
module.exports = {
|
||||
title: "Unleash",
|
||||
tagline: "The enterprise ready feature toggle service",
|
||||
url: "https://docs.getunleash.io",
|
||||
baseUrl: "/",
|
||||
onBrokenLinks: "throw",
|
||||
onBrokenMarkdownLinks: "warn",
|
||||
favicon: "img/favicon.ico",
|
||||
organizationName: "Unleash", // Usually your GitHub org/user name.
|
||||
projectName: "unleash.github.io", // Usually your repo name.
|
||||
title: 'Unleash',
|
||||
tagline: 'The enterprise ready feature toggle service',
|
||||
url: 'https://docs.getunleash.io',
|
||||
baseUrl: '/',
|
||||
onBrokenLinks: 'throw',
|
||||
onBrokenMarkdownLinks: 'warn',
|
||||
favicon: 'img/favicon.ico',
|
||||
organizationName: 'Unleash', // Usually your GitHub org/user name.
|
||||
projectName: 'unleash.github.io', // Usually your repo name.
|
||||
trailingSlash: false,
|
||||
themeConfig: {
|
||||
defaultMode: 'light',
|
||||
disableSwitch: true,
|
||||
@ -18,92 +19,103 @@ module.exports = {
|
||||
indexName: 'getunleash',
|
||||
},
|
||||
navbar: {
|
||||
title: "Unleash",
|
||||
title: 'Unleash',
|
||||
logo: {
|
||||
alt: "Unleash logo",
|
||||
src: "img/logo.svg"
|
||||
alt: 'Unleash logo',
|
||||
src: 'img/logo.svg',
|
||||
},
|
||||
items: [
|
||||
{ to: "/", label: "Documentation", activeBaseRegex: '(user_guide|sdks|addons|advanced)', },
|
||||
{ to: "deploy/getting_started", label: "Deploy and manage" },
|
||||
{ to: "integrations/integrations", label: "Integrations" },
|
||||
{ to: "/api", label: "API" },
|
||||
{ href: "https://www.getunleash.io/plans", label: "Unleash Enterprise", position: 'right' },
|
||||
{
|
||||
to: '/',
|
||||
label: 'Documentation',
|
||||
activeBaseRegex: '(user_guide|sdks|addons|advanced)',
|
||||
},
|
||||
{ to: 'deploy/getting_started', label: 'Deploy and manage' },
|
||||
{ to: 'integrations/integrations', label: 'Integrations' },
|
||||
{ to: '/api', label: 'API' },
|
||||
{
|
||||
href: 'https://www.getunleash.io/plans',
|
||||
label: 'Unleash Enterprise',
|
||||
position: 'right',
|
||||
},
|
||||
{
|
||||
href: 'https://github.com/Unleash/unleash',
|
||||
position: 'right',
|
||||
className: 'header-github-link',
|
||||
'aria-label': 'GitHub repository',
|
||||
},
|
||||
]
|
||||
],
|
||||
},
|
||||
prism: {
|
||||
additionalLanguages: ['java', 'swift', 'ruby', 'csharp', 'kotlin'],
|
||||
},
|
||||
footer: {
|
||||
style: "dark",
|
||||
style: 'dark',
|
||||
links: [
|
||||
{
|
||||
title: "Product",
|
||||
title: 'Product',
|
||||
items: [
|
||||
{
|
||||
label: "Docs",
|
||||
to: "/"
|
||||
label: 'Docs',
|
||||
to: '/',
|
||||
},
|
||||
{
|
||||
label: "Open-Source",
|
||||
href: "https://github.com/Unleash/unleash"
|
||||
label: 'Open-Source',
|
||||
href: 'https://github.com/Unleash/unleash',
|
||||
},
|
||||
{
|
||||
label: "Roadmap",
|
||||
href: "https://github.com/orgs/Unleash/projects/5"
|
||||
}
|
||||
]
|
||||
label: 'Roadmap',
|
||||
href: 'https://github.com/orgs/Unleash/projects/5',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Community",
|
||||
title: 'Community',
|
||||
items: [
|
||||
{
|
||||
label: "Stack Overflow",
|
||||
href: "https://stackoverflow.com/questions/tagged/unleash"
|
||||
label: 'Stack Overflow',
|
||||
href:
|
||||
'https://stackoverflow.com/questions/tagged/unleash',
|
||||
},
|
||||
{
|
||||
label: "Slack",
|
||||
href: "https://join.slack.com/t/unleash-community/shared_invite/zt-8b6l1uut-LL67kLpIXm9bcN3~6RVaRQ"
|
||||
label: 'Slack',
|
||||
href:
|
||||
'https://join.slack.com/t/unleash-community/shared_invite/zt-8b6l1uut-LL67kLpIXm9bcN3~6RVaRQ',
|
||||
},
|
||||
{
|
||||
label: "Twitter",
|
||||
href: "https://twitter.com/getunleash"
|
||||
}
|
||||
]
|
||||
}
|
||||
label: 'Twitter',
|
||||
href: 'https://twitter.com/getunleash',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
copyright: `Copyright © ${new Date().getFullYear()} Unleash. Built with Docusaurus.`,
|
||||
logo: {
|
||||
src: 'img/logo.svg',
|
||||
alt: 'Unleash logo'
|
||||
}
|
||||
alt: 'Unleash logo',
|
||||
},
|
||||
},
|
||||
gtag: {
|
||||
trackingID: "UA-134882379-1"
|
||||
trackingID: 'UA-134882379-1',
|
||||
},
|
||||
image: 'img/logo.png'
|
||||
image: 'img/logo.png',
|
||||
},
|
||||
presets: [
|
||||
[
|
||||
"@docusaurus/preset-classic",
|
||||
'@docusaurus/preset-classic',
|
||||
{
|
||||
docs: {
|
||||
sidebarPath: require.resolve("./sidebars.js"),
|
||||
sidebarPath: require.resolve('./sidebars.js'),
|
||||
// Please change this to your repo.
|
||||
editUrl: "https://github.com/Unleash/unleash/edit/master/websitev2/",
|
||||
routeBasePath: "/"
|
||||
editUrl:
|
||||
'https://github.com/Unleash/unleash/edit/master/websitev2/',
|
||||
routeBasePath: '/',
|
||||
},
|
||||
theme: {
|
||||
customCss: require.resolve("./src/css/custom.css")
|
||||
}
|
||||
}
|
||||
]
|
||||
customCss: require.resolve('./src/css/custom.css'),
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
plugins: [
|
||||
[
|
||||
@ -113,27 +125,34 @@ module.exports = {
|
||||
redirects: [
|
||||
{
|
||||
to: '/sdks',
|
||||
from: ['/user_guide/client-sdk', '/client-sdk', '/user_guide/connect_sdk']
|
||||
from: [
|
||||
'/user_guide/client-sdk',
|
||||
'/client-sdk',
|
||||
'/user_guide/connect_sdk',
|
||||
],
|
||||
},
|
||||
{
|
||||
to: '/user_guide/api-token',
|
||||
from: '/deploy/user_guide/api-token'
|
||||
from: '/deploy/user_guide/api-token',
|
||||
},
|
||||
{
|
||||
to: '/sdks/unleash-proxy',
|
||||
from: '/user_guide/native_apps/'
|
||||
from: '/user_guide/native_apps/',
|
||||
},
|
||||
{
|
||||
to: '/advanced/toggle_variants',
|
||||
from: '/toggle_variants'
|
||||
}
|
||||
from: '/toggle_variants',
|
||||
},
|
||||
],
|
||||
createRedirects: function (toPath) {
|
||||
if (toPath.indexOf("/docs/") === -1 && toPath.indexOf("index.html") === -1) {
|
||||
return `/docs/${toPath}`
|
||||
createRedirects: function(toPath) {
|
||||
if (
|
||||
toPath.indexOf('/docs/') === -1 &&
|
||||
toPath.indexOf('index.html') === -1
|
||||
) {
|
||||
return `/docs/${toPath}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
|
@ -10,90 +10,100 @@
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
"documentation": {
|
||||
"Getting started": [
|
||||
"user_guide/index",
|
||||
"user_guide/v4-whats-new",
|
||||
"user_guide/create_feature_toggle",
|
||||
"user_guide/activation_strategy",
|
||||
"user_guide/control_rollout",
|
||||
"user_guide/projects",
|
||||
"user_guide/unleash_context",
|
||||
"user_guide/user-management",
|
||||
"user_guide/rbac",
|
||||
"user_guide/api-token",
|
||||
"user_guide/technical_debt"
|
||||
documentation: {
|
||||
'Getting started': [
|
||||
'user_guide/index',
|
||||
'user_guide/quickstart',
|
||||
'user_guide/important-concepts',
|
||||
'user_guide/v4-whats-new',
|
||||
'user_guide/create_feature_toggle',
|
||||
'user_guide/activation_strategy',
|
||||
'user_guide/control_rollout',
|
||||
'user_guide/projects',
|
||||
'user_guide/unleash_context',
|
||||
'user_guide/user-management',
|
||||
'user_guide/rbac',
|
||||
'user_guide/api-token',
|
||||
'user_guide/technical_debt',
|
||||
],
|
||||
"Unleash SDKs": [
|
||||
"sdks/index",
|
||||
"sdks/java_sdk",
|
||||
"sdks/node_sdk",
|
||||
"sdks/dot_net_sdk",
|
||||
"sdks/go_sdk",
|
||||
"sdks/python_sdk",
|
||||
"sdks/ruby_sdk",
|
||||
"sdks/unleash-proxy",
|
||||
"sdks/android_proxy_sdk",
|
||||
"sdks/proxy-javascript",
|
||||
"sdks/proxy-ios",
|
||||
"sdks/community"
|
||||
'Unleash SDKs': [
|
||||
'sdks/index',
|
||||
'sdks/java_sdk',
|
||||
'sdks/node_sdk',
|
||||
'sdks/dot_net_sdk',
|
||||
'sdks/go_sdk',
|
||||
'sdks/python_sdk',
|
||||
'sdks/ruby_sdk',
|
||||
'sdks/unleash-proxy',
|
||||
'sdks/android_proxy_sdk',
|
||||
'sdks/proxy-javascript',
|
||||
'sdks/proxy-react',
|
||||
'sdks/proxy-ios',
|
||||
'sdks/community',
|
||||
],
|
||||
"Addons": [
|
||||
"addons/index",
|
||||
"addons/webhook",
|
||||
"addons/slack",
|
||||
"addons/teams",
|
||||
"addons/datadog"
|
||||
Addons: [
|
||||
'addons/index',
|
||||
'addons/webhook',
|
||||
'addons/slack',
|
||||
'addons/teams',
|
||||
'addons/datadog',
|
||||
],
|
||||
Advanced: [
|
||||
'advanced/strategy_constraints',
|
||||
'advanced/custom_activation_strategy',
|
||||
'advanced/feature_toggle_types',
|
||||
'advanced/toggle_variants',
|
||||
'advanced/archived_toggles',
|
||||
'advanced/audit_log',
|
||||
'advanced/api_access',
|
||||
'advanced/tags',
|
||||
'advanced/enterprise-authentication',
|
||||
],
|
||||
"Advanced": [
|
||||
"advanced/strategy_constraints",
|
||||
"advanced/custom_activation_strategy",
|
||||
"advanced/feature_toggle_types",
|
||||
"advanced/toggle_variants",
|
||||
"advanced/archived_toggles",
|
||||
"advanced/audit_log",
|
||||
"advanced/api_access",
|
||||
"advanced/tags",
|
||||
"advanced/enterprise-authentication"
|
||||
]
|
||||
},
|
||||
"api": {
|
||||
"Introduction": ["api/index", "api/internal/internal", "api/internal/health","api/open_api"],
|
||||
"Admin API": [
|
||||
"api/admin/features",
|
||||
"api/admin/features-archive",
|
||||
"api/admin/strategies",
|
||||
"api/admin/metrics",
|
||||
"api/admin/events",
|
||||
"api/admin/state",
|
||||
"api/admin/feature-types",
|
||||
"api/admin/addons",
|
||||
"api/admin/context",
|
||||
"api/admin/projects",
|
||||
"api/admin/user-admin"
|
||||
api: {
|
||||
Introduction: [
|
||||
'api/index',
|
||||
'api/internal/internal',
|
||||
'api/internal/health',
|
||||
'api/open_api',
|
||||
],
|
||||
"Client SDK API": [
|
||||
"api/client/features",
|
||||
"api/client/register",
|
||||
"api/client/metrics"
|
||||
'Admin API': [
|
||||
'api/admin/features',
|
||||
'api/admin/features-archive',
|
||||
'api/admin/strategies',
|
||||
'api/admin/metrics',
|
||||
'api/admin/events',
|
||||
'api/admin/state',
|
||||
'api/admin/feature-types',
|
||||
'api/admin/addons',
|
||||
'api/admin/context',
|
||||
'api/admin/projects',
|
||||
'api/admin/user-admin',
|
||||
],
|
||||
'Client SDK API': [
|
||||
'api/client/features',
|
||||
'api/client/register',
|
||||
'api/client/metrics',
|
||||
],
|
||||
|
||||
},
|
||||
"Deploy and manage": {
|
||||
"Deploy & configure": [
|
||||
"deploy/getting_started",
|
||||
"deploy/configuring_unleash",
|
||||
"deploy/securing_unleash",
|
||||
"deploy/email",
|
||||
"deploy/google_auth",
|
||||
"deploy/database-setup",
|
||||
"deploy/database_backup",
|
||||
"deploy/migration_guide",
|
||||
"deploy/import_export",
|
||||
]
|
||||
'Deploy and manage': {
|
||||
'Deploy & configure': [
|
||||
'deploy/getting_started',
|
||||
'deploy/configuring_unleash',
|
||||
'deploy/securing_unleash',
|
||||
'deploy/email',
|
||||
'deploy/google_auth',
|
||||
'deploy/database-setup',
|
||||
'deploy/database_backup',
|
||||
'deploy/migration_guide',
|
||||
'deploy/import_export',
|
||||
],
|
||||
},
|
||||
Integrations: {
|
||||
Integrations: ['integrations/integrations'],
|
||||
JIRA: [
|
||||
'integrations/jira_plugin_installation',
|
||||
'integrations/jira_plugin_usage',
|
||||
],
|
||||
},
|
||||
"Integrations": {
|
||||
"Integrations": ["integrations/integrations"],
|
||||
"JIRA": ["integrations/jira_plugin_installation", "integrations/jira_plugin_usage"]
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user