@belvo/belvo-configcat-client

0.3.6 • Public • Published

configcat-client-wrapper

Install package

npm install @belvo/belvo-configcat-client

Import

import FeatureFlagClient from '@belvo/belvo-configcat-client'

How to use it

Auto Poll (120s)

FLAG_LIST = [{ name: 'flagKeyName', user: {}}]

const config = { featureFlags: FLAG_LIST, emittedEventName: 'onFeatureFlagValueChanged', configCatApiKey }
const featureFlag = FeatureFlagClient(config)
featureFlag.client.handler.on('onFeatureFlagValueChanged', onValueChanged)

Manual Poll

const config = {
  apiKey,
  mode: 'manual_poll'
}
const featureFlagClient = new FeatureFlagClient(config)
await featureFlagClient.client.forceRefreshAsync()
this.featureFlagClient = featureFlagClient

Then when you want to fetch the value:

const featureFlagValue = await this.featureFlagClient.client.getValueAsync(featureFlag, false, userProps)

## :busts_in_silhouette: Contributing


If you wish to submit a pull request, please be sure check the items on this list:
- [ ] Tests related to the changed code were executed
- [ ] The source code has been coded following the OWASP security best practices (https://owasp.org/www-pdf-archive/OWASP_SCP_Quick_Reference_Guide_v2.pdf).
- [ ] Commit message properly labeled
- [ ] There is a ticket associated to each PR. 

Readme

Keywords

none

Package Sidebar

Install

npm i @belvo/belvo-configcat-client

Weekly Downloads

1,602

Version

0.3.6

License

ISC

Unpacked Size

839 kB

Total Files

293

Last publish

Collaborators

  • gustavo-mancuzo
  • evandro-guedes-machado
  • sdks-belvo
  • f.viviani