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

nestjs-unleash-sdk

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-unleash-sdk

A Nestjs module using Unleash SDK

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
59
decreased by-32.95%
Maintainers
1
Weekly downloads
 
Created
Source

NestJS-Unleash-SDK

A NestJS module that uses Unleash SDK to manage feature flags.

code style: prettier


Getting Started

To start using this module, you can follow these steps:

  • Install the package by running npm install nestjs-unleash-sdk
  • Import the module into your NestJS application using the following code:

Setup the module

import { Module } from '@nestjs/common';
import { UnleashModule } from 'nestjs-unleash-sdk';

@Module({
  imports: [
    UnleashModule.forRoot({
      url: 'https://unleash.herokuapp.com/api',
      appName: 'nestjs-app',
      instanceId: 'to-define',
    }),
  ],
})
export class AppModule {}

Check a feature flag

import { Controller, Get, Query } from '@nestjs/common';
import { UnleashService } from 'nestjs-unleash-sdk';

@Controller()
export class AppController {
  constructor(private readonly unleashService: UnleashService) { }

  @Get()
  getHello(@Query('email') email: string): any {
    const options = { userId: email };
    const isEnabled = this.unleashService.client.isEnabled('feat', options);
    return isEnabled;
  }
}

TODO

  • Add feature flag decorators

FAQs

Package last updated on 18 Aug 2023

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