How to use unleash-client - 3 common examples

To help you get started, we’ve selected a few unleash-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Unleash / unleash / packages / unleash-demo-app / alot-of-clients.js View on Github external
.forEach((v, index) => {
        const instance = new unleash.Unleash({
            appName: `demo-app-${index % 5}`,
            instanceId: `index-${index}`,
            url: 'http://localhost:4242/',
            refreshIntervall: 4000,
            metricsInterval: 10000,
            strategies: [
                new unleash.Strategy('extra', true),
            ],
        });


        instance.on('ready', () => {
            console.log('connected to unleash', index);

            setInterval(() => {
                instance.isEnabled('toggle-1', null, Boolean(Math.round(Math.random() * 2)));
            }, Math.round(Math.random() * 1000));
            setInterval(() => {
                instance.isEnabled('toggle-2', null, Boolean(Math.round(Math.random() * 2)));
            }, 1500);
            setInterval(() => {
                instance.isEnabled('toggle-3', null, Boolean(Math.round(Math.random() * 2)));
            }, 1300);
github Unleash / unleash / packages / unleash-demo-app / alot-of-clients.js View on Github external
.forEach((v, index) => {
        const instance = new unleash.Unleash({
            appName: `demo-app-${index % 5}`,
            instanceId: `index-${index}`,
            url: 'http://localhost:4242/',
            refreshIntervall: 4000,
            metricsInterval: 10000,
            strategies: [
                new unleash.Strategy('extra', true),
            ],
        });


        instance.on('ready', () => {
            console.log('connected to unleash', index);

            setInterval(() => {
                instance.isEnabled('toggle-1', null, Boolean(Math.round(Math.random() * 2)));
github wellcometrust / wellcomecollection.org / common / services / unleash / feature-toggles.js View on Github external
function init(options) {
  return initialize(Object.assign(options, {
    url: 'https://weco-feature-flags.herokuapp.com/api/',
    refreshInterval: 60 * 1000,
    strategies: [new ActiveForUserInCohort(), new UserEnabled()]
  }));
}

unleash-client

Unleash Client for Node

Apache-2.0
Latest version published 4 days ago

Package Health Score

86 / 100
Full package analysis