vwo-fme-node-sdk
v1.8.0
Published
VWO Node/JavaScript SDK for Feature Management and Experimentation
Downloads
738
Readme
VWO Feature Management and Experimentation SDK for Node.js and JavaScript(browser)
Requirements
- Node 12+
Installation
# via npm
npm install vwo-fme-node-sdk --save
# via yarn
yarn add vwo-fme-node-sdk
Example
const { init } = require('vwo-fme-node-sdk');
const vwoClient = await init({
accountId: '123456', // VWO Account ID
sdkKey: '32-alpha-numeric-sdk-key', // SDK Key
});
// set user context
const userContext = { id: 'unique_user_id' };
// returns a flag object
const getFlag = await vwoClient.getFlag('feature_key', userContext);
// check if flag is enabled
const isFlagEnabled = getFlag.isEnabled();
// get variable
const intVar = getFlag.getVariable('int_variable_key');
// track event
vwoClient.trackEvent('add_to_cart', userContext, eventProperties);
Development Scripts
- Install dependencies and bootstrap git-hooks
yarn install
- Compile TypeScript code to JavaScript(ES6)
yarn tsc
- To run tests:
# for production
yarn run test:prod
# for development
yarn run test:dev
Contributing
Please go through our contributing guidelines
Code of Conduct
License
Copyright 2024 Wingify Software Pvt. Ltd.