diff --git a/website/docs/feature-flag-tutorials/javascript/implementing-feature-flags-js.md b/website/docs/feature-flag-tutorials/javascript/implementing-feature-flags-js.md index 0d8cbf3973..b23824bc55 100644 --- a/website/docs/feature-flag-tutorials/javascript/implementing-feature-flags-js.md +++ b/website/docs/feature-flag-tutorials/javascript/implementing-feature-flags-js.md @@ -6,27 +6,26 @@ slug: /feature-flag-tutorials/javascript import VideoContent from '@site/src/components/VideoContent.jsx'; -Hello! In this tutorial we'll show you how to add feature flags to a plain JavaScript app, using [Unleash](https://www.getunleash.io/) and the official [Unleash Browser SDK](/reference/sdks/javascript-browser). With Unleash, an open-source feature flag service, you can add feature flags to your application and release new features faster. +In this tutorial we'll show you how to add feature flags to a plain JavaScript app, using [Unleash](https://www.getunleash.io/) and the official [Unleash Browser SDK](/reference/sdks/javascript-browser). With Unleash, an open-source feature flag service, you can add feature flags to your application and release new features faster. -In this tutorial, we'll make a basic website all about... Corgis! We'll use the [dog.ceo API 🐶](https://dog.ceo/) with HTML, CSS, JS to retrive some images of Queen Elisabeth's favourite dogs. We'll use feature flags to decide whether to show some corgi fun facts alongside the images. +In this tutorial, we'll make a basic website about Corgis! We'll use the [dog.ceo API 🐶](https://dog.ceo/) with HTML, CSS, JS to retrieve some images of Queen Elizabeth's favorite dogs. We'll use feature flags to decide whether to show some Corgi fun facts alongside the images. ## Prerequisites For this tutorial, you'll need the following: - - Git - Docker and Docker Compose -- A modern browser +- A browser or IDE; you can also use [CodeSandbox](https://codesandbox.io/docs/learn)  -The Unleash Server is a **Feature Flag Control Service**, which manages your feature flags and lets you retrieve flag data. Unleash has a UI for creating and managing projects and feature flags. You can perform the same actions straight from your CLI or server-side app using the [Unleash API](/reference/api/unleash). +The Unleash Server is a **Feature Flag Control Service**, which manages your feature flags and lets you retrieve flag data. Unleash has a UI for creating and managing projects and feature flags. In this example, we'll set up a script to make requests to Unleash using the Unleash SDK and show/hide a DOM element based on the flag data we receive. -## Install a local feature flag provider +## Install Unleash -In this section, we'll install Unleash, run the instance locally, log in, and create a feature flag. If you prefer, you can use other tools instead of Unleash, but you'll need to update the code accordingly. +In this section, we'll install Unleash, run the instance locally, log in, and create a feature flag. -Use Git to clone the Unleash repository and Docker to build and run it. Open a terminal window and run the following commands: +First, use Git to clone the Unleash repository and Docker to build and run it. Open a terminal window and run the following commands: ``` git clone https://github.com/unleash/unleash.git @@ -34,9 +33,9 @@ cd unleash docker compose up -d ``` -You will now have Unleash installed onto your machine and running in the background. You can access this instance in your web browser at [http://localhost:4242](http://localhost:4242). +You now have Unleash installed on your machine and running in the background. You can access this instance in your web browser at [http://localhost:4242](http://localhost:4242). -Log in to the platform using these credentials: +Log in to the Unleash Admin UI using the following credentials: ``` Username: admin @@ -49,11 +48,11 @@ Click **New feature flag** to create a new feature flag. Call it `show-info` and enable it in the `development` environment. -Everything's now set up on the Unleash side. Let's go to the code now. +Everything's now set up in Unleash. Let's look at the HTML and JavaScript code next. ## Make a basic HTML website -Open a new tab in your terminal, and create a new folder (outside of the unleash folder). +Open a new tab in your terminal, and create a new folder outside of the Unleash folder. ```sh mkdir unleash-js @@ -61,7 +60,7 @@ cd unleash-js touch index.html ``` -Add our HTML: +In the `index.html` file, add the following: ```html @@ -93,7 +92,7 @@ Add our HTML: