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
// Used to set the context fields, shared with the Unleash Proxy
unleash.updateContext({ userId: '1233' });
// Start the background polling
unleash.start();
```
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
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:
> 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 to DigitalOcean](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/Unleash/unleash/tree/main&refcode=0e1d75187044)
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.
Each container that runs in your local Docker instance must have a unique name. If you've run these commands before, you can either start the containers again (`docker start ${CONTAINER_NAME}`) or remove them (`docker rm ${CONTAINER_NAME}`) and run the commands again.
Follow steps outlined in the [Run Unleash with Docker](#run-unleash-with-docker) section to get the Unleash instance up and running. Once you have done that you need to first get an API key from your Unleash instance and then use that API key when starting the Unleash proxy.
![The Unleash UI showing a dropdown menu under the Configure menu entry. The dropdown menu's API Access option is highlighted and you're told to navigate there.](/img/api_access_navigation.png 'Navigate to the API access page.')
Depending on whether you have the environments feature enabled or not, the API key will look a little different. If you don't have environments enabled, it'll just be a 64 character long hexadecimal string (for instance `be44368985f7fb3237c584ef86f3d6bdada42ddbd63a019d26955178`). If you do have environments enabled, the key will be prefixed with the project and the environment that the key is valid for. It'll use the format `<project>:<environment>.<key>`, e.g. `demo-app:production.be44368985f7fb3237c584ef86f3d6bdada42ddbd63a019d26955178`.
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.