0.0.22 • Published 2 years ago

@indigov/flags-api v0.0.22

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

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.

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago