SDKs
Node.js

Node.js

Installation

$ npm install --save @progressively/sdk-node

Usage

Create an SDK instance

const { Progressively } = require("@progressively/sdk-node");
 
// These options are only necessary when self hosting
const options = {
  apiUrl: "your url server",
};
 
const sdk = Progressively.init("YOUR_ENVIRONMENT_CLIENT_KEY", options);

The options object can also receive other (optional) attributes such as fields

fields is an option that allows passing data about your users to restrain the audience eligibility. For instance, you can set an email field, and in Progressively's dashboard, you can create a rule that only targets people that matches that field:

// These options are only necessary when self hosting
const options = {
  apiUrl: "your url server",
  websocketUrl: "your url server for websockets",
  fields: {
    email: "@progressively.com",
  },
};

Load the flags

Makes an HTTP request to the Progressively server to retrieve the status of the flags.

sdk.loadFlags();