Skip to content

VWO Feature Management and Experimentation SDK for Node.js and JavaScript(browser)

License

Notifications You must be signed in to change notification settings

wingify/vwo-fme-node-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VWO Feature Management and Experimentation SDK for Node.js and JavaScript(browser)

npm version License

CI codecov

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

  1. Install dependencies and bootstrap git-hooks
yarn install
  1. Compile TypeScript code to JavaScript(ES6)
yarn tsc
  1. 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

Code of Conduct

License

Apache License, Version 2.0

Copyright 2024 Wingify Software Pvt. Ltd.

About

VWO Feature Management and Experimentation SDK for Node.js and JavaScript(browser)

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •