1.0.9 • Published 2 years ago

remoteflags-nodejs-client v1.0.9

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

alt text

remoteflags-nodejs-client

npm version

Remote Flags nodejs sdk to integrate with Public API to fetch flag status.

For more information on usage checkout our Docs page!

Installation

npm

Install it via:

npm install remoteflags-nodejs-client --save

Getting Started

Please follow the installation instruction and execute the following JS code:

const client = require('remoteflags-nodejs-client');
client.ApiClient.instance.authentications['RemoteFlagsAuthorizer'].apiKey = "<YOUR_API_KEY>";
const api = new client.PublicApi()

const ownerId = "<YOUR_OWNER_ID>"; // {String} OwnerID to fetch status for
const flagId = "<YOUR_FLAG_ID>"; // {String} FlagId to fetch status for

// optional parameters
const opts = {
  'segment': "status", // {String} The segment to get status from. Required for multi-segment flags. For single segment flag skip this.
  'key': "key_example" // {String} An identifier to be a key to associate the status with. This is used on flag which status you need to be consistent after the first random generated. For always random status behavior skip this.
};
api.getStatus(ownerId, flagId, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

All URIs are relative to https://api.remoteflags.com

ClassMethodHTTP requestDescription
RemoteflagsNodejsClient.PublicApidevToggleIdOptionsOPTIONS /dev-toggle/{id}
RemoteflagsNodejsClient.PublicApiget1ClickStatusGET /dev-toggle/{id}Get a flag status for 1 click toggle.
RemoteflagsNodejsClient.PublicApigetFlagUsageGET /usage/owner/{ownerId}/flag/{flagId}Get a flag usage data.
RemoteflagsNodejsClient.PublicApigetOwnerUsageGET /usage/owner/{ownerId}Get usage data for an owner.
RemoteflagsNodejsClient.PublicApigetStatusGET /status/owner/{ownerId}/flag/{flagId}Get a flag status.
RemoteflagsNodejsClient.PublicApistatusOwnerOwnerIdFlagFlagIdOptionsOPTIONS /status/owner/{ownerId}/flag/{flagId}
RemoteflagsNodejsClient.PublicApiusageOwnerOwnerIdFlagFlagIdOptionsOPTIONS /usage/owner/{ownerId}/flag/{flagId}
RemoteflagsNodejsClient.PublicApiusageOwnerOwnerIdOptionsOPTIONS /usage/owner/{ownerId}

Documentation for Models

Documentation for Authorization

RemoteFlagsAuthorizer

  • Type: API key
  • API key parameter name: authorizationToken
  • Location: HTTP header
1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago