Skip to content

Commit

Permalink
Update quickstart guide (#8523)
Browse files Browse the repository at this point in the history
  • Loading branch information
melindafekete authored Oct 25, 2024
1 parent 5662fe7 commit 3076bb4
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 120 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ If you don't want to run Unleash locally, we also provide easy deployment setups

### Configure and run Unleash anywhere

The above sections show you how to get up and running quickly and easily. When you're ready to start configuring and customizing Unleash for your own environment, check out the documentation for [getting started with self-managed deployments](https://docs.getunleash.io/reference/deploy/getting-started), [Unleash configuration options](https://docs.getunleash.io/reference/deploy/configuring-unleash), or [running Unleash locally via docker](https://docs.getunleash.io/tutorials/quickstart#i-want-to-run-unleash-locally).
The above sections show you how to get up and running quickly and easily. When you're ready to start configuring and customizing Unleash for your own environment, check out the documentation for [getting started with self-managed deployments](https://docs.getunleash.io/reference/deploy/getting-started), [Unleash configuration options](https://docs.getunleash.io/reference/deploy/configuring-unleash), or [running Unleash locally via docker](https://docs.getunleash.io/tutorials/quickstart).

<br/>

Expand Down
119 changes: 0 additions & 119 deletions website/docs/quickstart.md

This file was deleted.

145 changes: 145 additions & 0 deletions website/docs/quickstart.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
---
title: Quickstart
---

import Tabs from '@theme/Tabs';

import TabItem from '@theme/TabItem';

This guide helps you set up Unleash in just a few minutes. The fastest way to get started is by using [Docker](#set-up-unleash-with-docker). If Docker doesn't work for you, see [other ways to try Unleash](#additional-ways-to-try-unleash).

## Set up Unleash with Docker

### Start Unleash locally

To start Unleash locally, clone the [Unleash repository](https://github.com/Unleash/unleash) and start the server with Docker Compose:

```shell
git clone [email protected]:Unleash/unleash.git

cd unleash
docker compose up -d
```

### Log in to the Unleash Admin UI

In your browser, go to [http://localhost:4242](http://localhost:4242) and log in using the following credentials:
- **username**: `admin`
- **password**: `unleash4all`

![Unleash Admin UI log in screen](/img/quickstart-login.png)

### Create your first flag

To create your first flag:
1. 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 an SDK

Next, use one of the client or server-side [SDKs](/reference/sdks) to connect Unleash with your application.

1. Create an API token:
- For client-side SDKs, use a [frontend token](/reference/api-tokens-and-client-keys#front-end-tokens).
- For server-side SDKs, use a [client token](/reference/api-tokens-and-client-keys#client-tokens).
2. Determine your Unleash URL:
- For client-side SDKs, use `<your-unleash-instance>/api/frontend`.
- For server-side SDKs, use `<your-unleash-instance>/api`.
3. Use the SDK to connect to Unleash in your application.

The following example shows how to use the [JavaScript SDK](/reference/sdks/javascript-browser) and the [Node.js SDK](/reference/sdks/node) to connect to your Unleash instance:


<Tabs groupId="connect-sdk-quickstart">

<TabItem value="sdk-client-side" label="Connect a client-side SDK">

```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">

```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>

## Other ways to try Unleash

### Unleash demo instance

You can also use the [Unleash demo instance](https://app.unleash-hosted.com/demo/) to test different use cases before setting up your own instance. This is a [Pro](https://www.getunleash.io/pricing) version available at `https://app.unleash-hosted.com/demo/`.

To run tests on this instance, use the following API URLs and keys:

- **Client-side:**
- API URL: `https://app.unleash-hosted.com/demo/api/frontend`
- Frontend key: `demo-app:default.bf8d2a449a025d1715a28f218dd66a40ef4dcc97b661398f7e05ba67`
- **Server-side:**
- API URL: `https://app.unleash-hosted.com/demo/api`
- Client key: `56907a2fa53c1d16101d509a10b78e36190b0f918d9f122d`

To test the credentials and retrieve feature flags, run this command:

```shell
curl https://app.unleash-hosted.com/demo/api/client/features \
-H "Authorization: 56907a2fa53c1d16101d509a10b78e36190b0f918d9f122d"
```

### Other local setup options

For other ways to get started locally, see the steps for [starting an Unleash server](using-unleash/deploy/getting-started#start-unleash-server).

## Hosting Unleash

#### Hosted by Unleash

With our [Pro and Enterprise plans](https://www.getunleash.io/pricing), you can run Unleash in the cloud by using our hosted offerings.

#### Self-hosted

Self-hosting Unleash is available for [Open-Source](https://www.getunleash.io/pricing) and [Enterprise](https://www.getunleash.io/pricing) customers. Visit [Self-hosting Unleash](/using-unleash/deploy) to learn more.

## Next steps

Check out our reference documentation that explains all [core concepts](/reference) you need to get the most out of Unleash.

Explore feature flag best practices and language-specific tutorials in our [developer guides](/topics).
Binary file added website/static/img/quickstart-login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3076bb4

Please sign in to comment.