npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@snowfrog/ngx-unleash-proxy-client

v2.0.1

Published

Unleash Proxy Client SDK for Angular

Readme

ngx-unleash-proxy-client

This library is meant to be used with the unleash-proxy. The proxy application layer will sit between your unleash instance and your client applications, and provides performance and security benefits. DO NOT TRY to connect this library directly to the unleash instance, as the datasets follow different formats because the proxy only returns evaluated toggle information.

Getting started

Step 1: Unleash Proxy

Before you can use this Unleash SDK you need to set up a Unleash Proxy instance. Read more about the Unleash Proxy.

Step 2: Install

npm install @snowfrog/ngx-unleash-proxy-client

Following this, you'll probably have to install some peer dependencies that you do not yet have installed in your project. They will be listed in the output from the npm install command.

Example of a peer dependency that you'll probably need to install:

npm install unleash-proxy-client

Step 3: Initialize the SDK

You need to have a Unleash-hosted instance, and the proxy needs to be enabled. In addition you will need a proxy-specific clientKey in order to connect to the Unleash-hosted Proxy.

Here is how to initialize the client SDK:

import { NgxUnleashProxyClientModule } from '@snowfrog/ngx-unleash-proxy-client';

@NgModule({
  imports: [
    NgxUnleashProxyClientModule.init({
      url: 'https://unleash-proxy.myapp.com/proxy',
      clientKey: 'MyClientKey',
      appName: 'My Angular App Name',
    }),
  ],
})
export class AppModule {}

This step will initialize the library, before the Angular app is completely bootstrapped, insuring that the library is ready to use and the toggle data is available before users can interact with the app.

How to check toggle states

To check if a toggle is enabled from within a Component or Service, you can use the isEnabled method:

import { UnleashService } from '@snowfrog/ngx-unleash-proxy-client';

@Component({
  selector: 'test-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
})
export class TestComponent {
  constructor(private unleash: UnleashService) {}
  get title(): string {
    if (this.unleash.isEnabled('test.toggle')) {
      return 'The toggle is on';
    }
    return 'The toggle is off';
  }
}

To check if a toggle is enabled from within a Component template, you can use the unleash and unleashNot directives:

<some-component *unleash="'test.toggle'"></some-component>
<some-other-component *unleashNot="'test.toggle'"></some-other-component>

To prevent navigation to a route based on a toggle, you can use the UnleashGuard:

import { UnleashGuard } from '@snowfrog/ngx-unleash-proxy-client';

const routes = [
  {
    path: 'test',
    component: TestComponent,
    canActivate: [UnleashGuard],
    data: { toggleName: 'test.toggle', shouldBe: true, redirectUrl: '/' },
  },
];

To check variants:

import { UnleashService } from '@snowfrog/ngx-unleash-proxy-client';

@Component({
  selector: 'test-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
})
export class TestComponent {
  constructor(private unleash: UnleashService) {}
  get title(): string {
    const variant = this.unleash.getVariant('test.variant');
    if(variant === 'blue) {
      // something with variant blue
    }
}

How to update the Unleash Context

Follow the following steps in order to update the Unleash context:

import { UnleashService } from '@snowfrog/ngx-unleash-proxy-client';

@Injectable()
export class SomeService {
  constructor(private unleash: UnleashService) {}

  someOperation() {
    this.unleash.updateContext({
      userId: '123',
      userName: 'John Doe',
      userEmail: '[email protected]',
    });
  }
}

Documentation

https://snowfrogdev.github.io/snowfrogdev/ngx-unleash-proxy-client/

License

MIT License

Copyright (c) 2022 Philippe Vaillancourt

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.