0.0.21 • Published 1 year ago

@josemarinho/unleash v0.0.21

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Description

Nest Lib To Communicate With Unleash Feature Toggle.

Installation

$ npm install @josemarinho/unleash

Running the app

Once the installation process is complete, we can import the UnleashModule into the root AppModule.

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

@Module({
  imports: [
    UnleashModule.forRoot({
      appName: 'app-name',
      url: 'unleash-url',
      instanceId: 'instance-id',
      http: {
        headers: {
          Authorization: 'UNLEASH_API_TOKEN',
        },
      },
    }),
  ],
  ...
})
export class AppModule {}

Utilization

For get feature toggles from unleash, its necessary inject UnleashService

import { Injectable } from '@nestjs/common';
import { UnleashService } from '@josemarinho/unleash';

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

  async get(key: string) {
    return await this.unleash.isEnabled(key);
  }
}

After your app it's ready to running.

0.0.21

1 year ago

0.0.20

1 year ago

0.0.18

1 year ago

0.0.17

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago