An example app built using the DevCycle JavaScript SDK
This example app requires that your project has a feature with the expected variables, as well as some simple targeting rules.
⇨ Click here to automatically create the feature in your project ⇦
When you run the example app and switch your identity between users, you'll be able to see the feature's different variations.
- Run
npm install
in the project directory to install dependencies - Create a
.env
file and setDEVCYCLE_CLIENT_SDK_KEY
to the SDK Key for your environment.
You can find this under Settings > Environments on the DevCycle dashboard. - Run
npm run build
to build the project - Open
index.html
to view it in your browser.
To experiment with targeting, update the user objects in src/users.js
based on your targeting rules.
Re-run npm run build
and refresh after making changes.
- Run
npm run test
to run the tests - See
src/devcycle.test.js
for examples of mocking the DevCycle SDK.