FeaturevisorFeaturevisor

SDKs

Node.js SDK

You can use the same Featurevisor JavaScript SDK in Node.js as well.

Installation

Install with npm:

$ npm install --save @featurevisor/sdk

API

Please find the full API docs in JavaScript SDK page.

Polyfills

fetch

Featurevisor JavaScript SDK relies on fetch API for fetching datafiles.

If your Node.js version does not support fetch globally, you can use isomorphic-fetch.

You can install it with npm:

$ npm install --save isomorphic-fetch

And then require() it in your code:

require("isomorphic-fetch");

Consuming the SDK

Require

If you are not dealing with ES Modules in Node.js, you can use require() as usual:

const { createInstance } = require("@featurevisor/sdk");

Import

If you want to take advantage of ES Modules, you can import the SDK directly:

import FeaturevisorSDK from "@featurevisor/sdk";

const { createInstance } = FeaturevisorSDK;

Example repository

You can refer to this repository that shows a fully working Node.js application using Featurevisor SDK: https://github.com/featurevisor/featurevisor-example-nodejs,

Previous
JavaScript