Skip to content

wingify/vwo-fme-node-sdk

Repository files navigation

VWO Feature Management and Experimentation SDK for Node.js

npm version CI

codecov

License

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 vwo.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('addToCart', 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.