Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@indigov/flags-api

Package Overview
Dependencies
Maintainers
14
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@indigov/flags-api

Strongly typed React/Node client for the Flags service

  • 0.0.22
  • latest
  • npm
  • Socket score

Version published
Maintainers
14
Created
Source

F.L.A.G.S. API Client

Cross-platform Typescript SDK for the Flags service.

Usage

Installation

yarn:

yarn add @indigov/flags-api

Instantiation

import Flags from '@indigov/flags-api'

const flags = new Flags('API_TOKEN', 'OFFICE_NAME', 'SOURCE_OF_REQUEST')
// e.g. 
flags = new Flags('435234sdfgswdasdf', 'indigovstaging', 'northstar')

Making requests

The SDK exposes 3 endpoints - documentation is in source code:

  1. getFlag
  2. getFlagValue
  3. getFlags
// Uses office supplied in instanttiation
flags.getFlag('bulkapi:flags:minifiedhtmlenabled').then(console.log)
// Uses supplied office AND cohort
flags.getFlag('bulkapi:flags:minifiedhtmlenabled', { cohort: 'tests' }).then(console.log)
// Fetching raw flag value
flags.getFlagValue('bulkapi:flags:minifiedhtmlenabled').then(console.log)

Local Development

TODO

Testing

Tests are run using jest backed by ts-jest to avoid the need for transpilation.

yarn test

Publishing

Run:

yarn publish

And pick a sensible SemVer.

Note: You must be logged into npm through the CLI and part of the Indigov org.

FAQs

Package last updated on 20 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc