mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-31 13:47:02 +02:00
134 lines
5.4 KiB
Plaintext
134 lines
5.4 KiB
Plaintext
---
|
|
title: Quickstart
|
|
pagination_next: topics/what-is-a-feature-flag
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
import SearchPriority from '@site/src/components/SearchPriority';
|
|
|
|
<SearchPriority level="high" />
|
|
|
|
The easiest way to get started with Unleash is through a [cloud-hosted free trial](https://www.getunleash.io/plans/enterprise-payg). This gives you a ready-to-use instance, so you can explore all Unleash features without any local setup.
|
|
|
|
In this guide, you'll:
|
|
|
|
1. **Sign up** for a free, cloud-hosted Unleash Enterprise instance.
|
|
|
|
2. **Create your first feature flag** using the Unleash Admin UI.
|
|
|
|
3. **Connect Unleash to your application** by integrating an SDK into your codebase.
|
|
|
|

|
|
|
|
If you prefer to manage your own infrastructure, see the [self-hosted setup guide](./using-unleash/deploy/getting-started). To use the open-source version, see the instructions in the [Unleash GitHub repository](https://github.com/Unleash/unleash?tab=readme-ov-file#get-started-with-unleash).
|
|
|
|
## Sign up for an Unleash Enterprise Cloud trial
|
|
|
|
Start by signing up for a [free 14-day trial](https://www.getunleash.io/plans/enterprise-payg) of Unleash Enterprise Cloud.
|
|
After you submit the form, you will receive a confirmation email. Follow the link in the email to set your password and log in to your Unleash instance.
|
|
|
|
## Create your first feature flag
|
|
|
|
Once you've logged in, it's time to create your first feature flag:
|
|
|
|
1. In the Unleash Admin UI, open the **Default** project.
|
|
2. Click **New feature flag**.
|
|
3. Enter a name, and click **Create feature flag**.
|
|
|
|
For more details on creating feature flags, see [How to create a feature flag](/how-to-create-feature-flag).
|
|
|
|
## Connect your application to Unleash
|
|
|
|
Next, use one of the client or server-side [SDKs](/reference/sdks) to connect Unleash with your application.
|
|
|
|
<details>
|
|
<summary>Need an example application to test with?</summary>
|
|
|
|
Explore our SDK examples directly in your browser with CodeSandbox. Check out the [Unleash SDK Examples](https://github.com/Unleash/unleash-sdk-examples) repository to try one now.
|
|
</details>
|
|
|
|
<Tabs groupId="connect-sdk-quickstart">
|
|
|
|
<TabItem value="sdk-client-side" label="Connect a client-side SDK">
|
|
|
|
1. **Create an API token**
|
|
|
|
In the Unleash Admin UI, create a [frontend API token](/reference/api-tokens-and-client-keys#frontend-tokens) in **Admin settings > Access control > API access**.
|
|
2. **Get your Unleash API URL**
|
|
|
|
Find the base URL of your Unleash Cloud instance (for example, `https://us.app.unleash-hosted.com/some-instance-id`). Your frontend API URL is this base URL with `/api/frontend` appended to it.
|
|
3. **Initialize the SDK**
|
|
|
|
In your application code, initialize the SDK using your API URL and token.
|
|
|
|
The following example shows how to use the [JavaScript SDK](/reference/sdks/javascript-browser) to connect to your Unleash instance:
|
|
|
|
```javascript title="JavaScript SDK"
|
|
import { UnleashClient } from "unleash-proxy-client";
|
|
|
|
const unleash = new UnleashClient({
|
|
url: "https://<YOUR_UNLEASH_INSTANCE>/api/frontend",
|
|
clientKey: "<YOUR_TOKEN>",
|
|
appName: "<YOUR_APP_NAME>",
|
|
});
|
|
|
|
unleash.on("synchronized", () => {
|
|
// Unleash is ready to serve updated feature flags.
|
|
|
|
// Check a feature flag
|
|
if (unleash.isEnabled("some-flag")) {
|
|
// do cool new things when the flag is enabled
|
|
}
|
|
});
|
|
```
|
|
|
|
</TabItem>
|
|
<TabItem value="sdk-server-side" label="Connect a server-side SDK">
|
|
|
|
1. **Create an API token**
|
|
|
|
In the Unleash Admin UI, create a [client API token](/reference/api-tokens-and-client-keys#client-tokens) in **Admin settings > Access control > API access**.
|
|
2. **Get your Unleash API URL**
|
|
|
|
Find the base URL of your Unleash Cloud instance (for example, `https://us.app.unleash-hosted.com/some-instance-id`). Your API URL is this base URL with `/api` appended to it.
|
|
3. **Initialize the SDK**
|
|
|
|
In your application code, initialize the SDK using your API URL and token.
|
|
|
|
The following example shows how to use the [Node.js SDK](/reference/sdks/node) to connect to your Unleash instance:
|
|
|
|
```javascript title="Node.js SDK"
|
|
const { initialize } = require("unleash-client");
|
|
|
|
const unleash = initialize({
|
|
url: "https://<YOUR_UNLEASH_INSTANCE>/api",
|
|
appName: "<YOUR_APP_NAME>",
|
|
customHeaders: {
|
|
Authorization: "<YOUR_TOKEN>",
|
|
},
|
|
});
|
|
|
|
unleash.on("synchronized", () => {
|
|
// Unleash is ready to serve updated feature flags.
|
|
|
|
if (unleash.isEnabled("some-flag")) {
|
|
// do cool new things when the flag is enabled
|
|
}
|
|
});
|
|
```
|
|
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
For examples that show how to connect to Unleash in other programming languages, see the [Unleash SDK Examples repository](https://github.com/Unleash/unleash-sdk-examples).
|
|
|
|
|
|
## Next steps
|
|
|
|
You have successfully connected Unleash to your application. To continue exploring, see the following resources:
|
|
|
|
- **Core concepts**: Learn about the [Unleash architecture](/understanding-unleash/unleash-overview), available [hosting options](/understanding-unleash/hosting-options), and other [reference documentation](/reference/projects).
|
|
- **Developer guides**: Explore feature flag [best practices](/topics/feature-flags/feature-flag-best-practices) and [language-specific tutorials](/feature-flag-tutorials/react).
|
|
- **Join the community**: Have questions or feedback? Join the [Unleash community on Slack](https://slack.unleash.run) to connect with other developers and the Unleash team.
|