Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 1.37 KB

File metadata and controls

44 lines (33 loc) · 1.37 KB

LaunchDarkly sample javascript application

We've built a simple browser application that demonstrates how this LaunchDarkly SDK works.

Below, you'll find the build procedure. For more comprehensive instructions, you can visit your Quickstart page or the {name of SDK} reference guide.

Prerequisites

Nodejs 20.6.0 or later

Build instructions

  1. Make a copy of the .env.template and name it .env

    cp .env.template .env
    
  2. Set the variables in .env to your specific LD values

    # Set LAUNCHDARKLY_CLIENT_SIDE_ID to your LaunchDarkly client-side ID
    LAUNCHDARKLY_CLIENT_SIDE_ID=
    
    # Set LAUNCHDARKLY_FLAG_KEY to the feature flag key you want to evaluate
    LAUNCHDARKLY_FLAG_KEY=
    

    [!NOTE] Setting these values is equivilent to modifying the clientSideID and flagKey in app.ts.

  3. Install and build the project:

    yarn && yarn build
  4. On the command line, run yarn start

    yarn start

    [!NOTE] The yarn start script simply runs open index.html. If that is not working for you, you can open the index.html file in a browser for the same results.

The application will run continuously and react to the flag changes in LaunchDarkly.