master | development |
---|---|
The Unlaunch Node.js SDK provides a Node.js API to access Unlaunch feature flags and other features. Using this SDK, you can easily build Javascript applications that can evaluate feature flags, dynamic configurations, and more.
- To create feature flags to use with Node.js SDK, login to your Unlaunch Console at https://app.unlaunch.io
- Official Guide
- Documentation
- Example Project
First install the Node SDK using your package manager.
npm install --save unlaunch-node-sdk
Next, require the UnlaunchFactory into your application.
const {UnlaunchFactory} = require('unlaunch-node-sdk');
Here is a simple example showing how to use the this SDK in your Node.js application.
let factory = UnlaunchFactory({
core:{
sdkKey:'INSERT_YOUR_SDK_KEY'
},
intervals: {
// fetch feature updates each 30 sec
pollingInterval: 30,
// publish metrics each 120 sec
metricsFlushInterval: 120,
// flush events every 60 seconds after the first flush
eventsFlushInterval: 60,
// http connection timeout
httpConnectionTimeout: 10
}
});
const client = factory.client();
client.once('READY',()=> {
const variation = client.variation('flag-1','user123');
console.log("variation served: "+ variation)
});
To run all tests
npm test
Create a new tag on GitHub in the following format vx.y.z e.g. v0.0.1
If you run into any problems, bugs, or have any questions or feedback, please report them using the issues feature. We'll respond to all issues usually within 24 to 48 hours.
Licensed under the Apache License, Version 2.0. See: Apache License.
Unlaunch is a Feature Release Platform for engineering teams. Our mission is allow engineering teams of all sizes to release features safely and quickly to delight their customers. To learn more about Unlaunch, please visit unlaunch.io. You can sign up to get started for free at https://app.unlaunch.io/signup.