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.
Nodejs 20.6.0 or later
-
Make a copy of the
.env.templateand name it.envcp .env.template .env -
Set the variables in
.envto 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
clientSideIDandflagKeyin app.ts. -
Install and build the project:
yarn && yarn build -
On the command line, run
yarn startyarn start
[!NOTE] The
yarn startscript simply runsopen index.html. If that is not working for you, you can open theindex.htmlfile in a browser for the same results.
The application will run continuously and react to the flag changes in LaunchDarkly.