Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bamada/nestjs-unleash-sdk
Nestjs unleash module using unleash-sdk
https://github.com/bamada/nestjs-unleash-sdk
nestjs typescript unleash
Last synced: 19 days ago
JSON representation
Nestjs unleash module using unleash-sdk
- Host: GitHub
- URL: https://github.com/bamada/nestjs-unleash-sdk
- Owner: bamada
- License: mit
- Created: 2023-02-12T00:04:35.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T14:13:08.000Z (22 days ago)
- Last Synced: 2024-10-29T17:22:09.023Z (22 days ago)
- Topics: nestjs, typescript, unleash
- Language: TypeScript
- Homepage:
- Size: 971 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/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
```bash
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
```bash
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