šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Book a DemoInstallSign in
Socket

unleash-proxy-client

Package Overview
Dependencies
Maintainers
3
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unleash-proxy-client

A browser client that can be used together with Unleash Edge or the Unleash Frontend API.

3.7.6
latest
Source
npm
Version published
Weekly downloads
240K
5.96%
Maintainers
3
Weekly downloads
Ā 
Created

What is unleash-proxy-client?

The unleash-proxy-client npm package is a client library for the Unleash Proxy, which is a feature management system. It allows you to control feature toggles in your application, enabling or disabling features without deploying new code. This is particularly useful for A/B testing, gradual rollouts, and canary releases.

What are unleash-proxy-client's main functionalities?

Initialize Client

This code initializes the Unleash client with the necessary configuration such as the URL of the Unleash Proxy, the client key, and the application name. The `start` method is called to begin fetching feature toggles.

const { UnleashClient } = require('unleash-proxy-client');

const unleash = new UnleashClient({
  url: 'https://app.unleash-hosted.com/demo/api/frontend',
  clientKey: 'your-client-key',
  appName: 'my-app'
});

unleash.start();

Check Feature Toggle

This code checks if a specific feature toggle is enabled. The `isEnabled` method returns a boolean indicating the status of the feature toggle.

const isEnabled = unleash.isEnabled('feature-toggle-name');
console.log(`Feature is enabled: ${isEnabled}`);

Register Event Listeners

This code registers event listeners for the Unleash client. The `update` event is triggered when feature toggles are updated, and the `error` event is triggered if there is an error fetching feature toggles.

unleash.on('update', () => {
  console.log('Feature toggles updated');
});

unleash.on('error', (error) => {
  console.error('Error fetching feature toggles:', error);
});

Other packages similar to unleash-proxy-client

FAQs

Package last updated on 01 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts