remoteflags-nodejs-client
v1.0.9
Published
Remote Flags nodejs client. Access Public API for integration with Remote Flags.
Downloads
3
Readme
remoteflags-nodejs-client
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
Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- RemoteflagsNodejsClient.PublicApi | devToggleIdOptions | OPTIONS /dev-toggle/{id} | RemoteflagsNodejsClient.PublicApi | get1ClickStatus | GET /dev-toggle/{id} | Get a flag status for 1 click toggle. RemoteflagsNodejsClient.PublicApi | getFlagUsage | GET /usage/owner/{ownerId}/flag/{flagId} | Get a flag usage data. RemoteflagsNodejsClient.PublicApi | getOwnerUsage | GET /usage/owner/{ownerId} | Get usage data for an owner. RemoteflagsNodejsClient.PublicApi | getStatus | GET /status/owner/{ownerId}/flag/{flagId} | Get a flag status. RemoteflagsNodejsClient.PublicApi | statusOwnerOwnerIdFlagFlagIdOptions | OPTIONS /status/owner/{ownerId}/flag/{flagId} | RemoteflagsNodejsClient.PublicApi | usageOwnerOwnerIdFlagFlagIdOptions | OPTIONS /usage/owner/{ownerId}/flag/{flagId} | RemoteflagsNodejsClient.PublicApi | usageOwnerOwnerIdOptions | OPTIONS /usage/owner/{ownerId} |
Documentation for Models
- RemoteflagsNodejsClient.Status
- RemoteflagsNodejsClient.Usage
- RemoteflagsNodejsClient.UsageRequestInner
Documentation for Authorization
RemoteFlagsAuthorizer
- Type: API key
- API key parameter name: authorizationToken
- Location: HTTP header