Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

unleash-proxy-client

Package Overview
Dependencies
Maintainers
3
Versions
90
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 the unleash-proxy.

  • 3.6.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
178K
decreased by-3.83%
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 04 Sep 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc