0.11.0 • Published 1 year ago

@justeat/f-feature-management v0.11.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

Feature Management

This service allows querying of feature flags as configured using the Feature Management service via an injectable Nuxt plugin

Usage

To create an instance of the service:

const featuresService = new FeaturesService(store, {
    httpClient: $axios, // nuxt-axios plugin instance or compliant http client
    cookies: $cookies, // cookie-universal-nuxt plugin or compliant cookie store
    analytics: $gtm, // @justeat/f-analytics instance
    log: $log // See below
});

To manually fetch a new configuration file from the CDN:

await featuresService.update();

To inject as a nuxt plugin:

inject('features', featuresService.plugin);

Configuration

The following configuration should be available in the store:

{
  scope: 'my-scope', // your team / component scope
  environment: 'development', // development | production
  obfuscationKey: 'xtpEe9PoYlHTv14hJq6m', // key provided with scope
  pollInterval: 1000 * 60 // How frequently config should be polled for in ms
}

The service accesses this configuration from the store at the following location:

store.state.configuration.settings.featureManagement

Logging

The log class must provide the following interface:

class Log {
  info (message, tags, payload = {}) { ... }

  warn (message, tags, payload = {}) { ... }

  error (message, exception, tags, payload = {}) { ... }
}
0.11.0

1 year ago

0.10.2

2 years ago

0.10.1

2 years ago

0.10.0

3 years ago

0.9.1

3 years ago

0.9.0

3 years ago

0.8.0

3 years ago

0.7.2

3 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago