LaunchDarkly Sample Client-Side Node.js Application
We've built a simple console application that demonstrates how LaunchDarkly's SDK works. Below, you'll find the basic build procedure, but for more comprehensive instructions, you can visit your Quickstart page.
For a sample application demonstrating how to use LaunchDarkly in server-side Node.js applications, refer to our Server-side Node.js SDK sample application.
Install the LaunchDarkly Client-Side Node.js SDK by running
index.jsand set the value of
environmentIdto your LaunchDarkly client-side ID. If there is an existing boolean feature flag in your LaunchDarkly project that you want to evaluate, set
featureFlagKeyto the flag key.
const environmentId = "1234567890abcdef"; const featureFlagKey = "my-flag";
You should see the message
"Feature flag '<flag key>' is <true/false> for this user".