@indigov/flags-api
TypeScript icon, indicating that this package has built-in type declarations

0.0.22 • Public • Published

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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.223latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.223
0.0.210
0.0.200
0.0.180
0.0.170
0.0.160
0.0.150
0.0.130
0.0.120
0.0.110
0.0.100
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i @indigov/flags-api

Weekly Downloads

3

Version

0.0.22

License

ISC

Unpacked Size

13.8 kB

Total Files

19

Last publish

Collaborators

  • christopher.silver
  • dmarg
  • lsapoz-indigov
  • jezgo
  • elindigov
  • indigovadmin
  • derjacques
  • youngkwangk
  • josephemswiler
  • ishwaryav