All Projects → nonfig → nestjs-config

nonfig / nestjs-config

Licence: MIT license
NestJS Module for Nonfig services. Nonfig combines Configurations and Features. So you change features, and release swiftly, and measure to digital impact.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to nestjs-config

Tweek
Tweek - an open source feature manager
Stars: ✭ 268 (+570%)
Mutual labels:  backend, feature-flags, feature-toggles
flagsmith-java-client
Java Client for Flagsmith. Ship features with confidence using feature flags and remote config. Host yourself or use our hosted version at https://www.flagsmith.com/
Stars: ✭ 16 (-60%)
Mutual labels:  feature-flags, feature-toggles
js-sdk
JavaScript frontend SDK for ConfigCat. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.
Stars: ✭ 21 (-47.5%)
Mutual labels:  feature-flags, feature-toggles
i3
Archivos de configuraciones de i3
Stars: ✭ 32 (-20%)
Mutual labels:  config, configurations
Toggler
Feature toggle library for PHP
Stars: ✭ 18 (-55%)
Mutual labels:  feature-flags, feature-toggles
ld-scheduler
Schedule Launch Darkly flags on or off
Stars: ✭ 14 (-65%)
Mutual labels:  feature-flags, feature-toggles
YMFF
Feature management made easy.
Stars: ✭ 26 (-35%)
Mutual labels:  feature-flags, feature-toggles
nestjs-zero-to-hero
Coding through the course: NestJS Zero to Hero - Modern TypeScript Backend Development
Stars: ✭ 23 (-42.5%)
Mutual labels:  backend, nestjs
ld-redux
A library to integrate launch darkly with react redux
Stars: ✭ 33 (-17.5%)
Mutual labels:  feature-flags, feature-toggles
eight ball
Ruby gem for querying feature flags
Stars: ✭ 17 (-57.5%)
Mutual labels:  feature-flags, feature-toggles
unleash-docker
Docker container for unleash
Stars: ✭ 89 (+122.5%)
Mutual labels:  feature-flags, feature-toggles
pheature-flags
Pheature flags main repository
Stars: ✭ 75 (+87.5%)
Mutual labels:  feature-flags, feature-toggles
doorkeeper
A Feature Toggle for PHP
Stars: ✭ 16 (-60%)
Mutual labels:  feature-flags, feature-toggles
cargo-i18n
A Rust Cargo sub-command and libraries to extract and build localization resources to embed in your application/library
Stars: ✭ 88 (+120%)
Mutual labels:  localization, localization-management
flipper
Feature Flipper, Feature Flags, Rollout Flags, Feature Toggles for Crystal
Stars: ✭ 21 (-47.5%)
Mutual labels:  feature-flags, feature-toggles
ruby-client
Ruby SDK client for Split Software
Stars: ✭ 22 (-45%)
Mutual labels:  feature-flags, feature-toggles
laravel-rollout
A package to integrate rollout into your Laravel project.
Stars: ✭ 23 (-42.5%)
Mutual labels:  feature-flags, feature-toggles
js-client-sdk
LaunchDarkly Client-side SDK for Browser JavaScript
Stars: ✭ 93 (+132.5%)
Mutual labels:  feature-flags, feature-toggles
MultiplatformPlayground
Kotlin Multiplatform project in Jetpack Compose & SwiftUI with shared ViewModel layer and File upload
Stars: ✭ 72 (+80%)
Mutual labels:  localization, backend
react-client
React JS SDK client for Split Software
Stars: ✭ 23 (-42.5%)
Mutual labels:  feature-flags, feature-toggles

Nonfig Logo Nest Logo

Nonfig NestJS Plugin

NestJS Module for Nonfig services. Nonfig combines Configurations and Features. So you change features, and release swiftly, and measure to digital impact.

CircleCI NPM Version Package License NPM Downloads

Summary

📦 Installation

  • Using Nest CLI:
nest add @nonfig/nestjs-config
  • Using Package Manager:
npm install --save @nonfig/nestjs-config
  • Using Yarn
yarn add @nonfig/nestjs-config

🔧 Setup

Explain your library setup.

import { Module } from '@nestjs/common';
import { NonfigModule, NonfigOptions } from '@nonfig/nestjs-config';

const CONFIG: NonfigOptions = {
  appId: '<Your Application ID>',
  appSecret: '<Your Application Secret>',
  cacheTtl: 60000  
}

@Module({
  imports: [
    ...
    NonfigModule.register(CONFIG)
  ],
  controllers: [ ... ],
  providers: [ ... ],
})
export class AppModule {}

🎛️ Config

Name Type Default Description Required
appId string <DEFAULT> Nonfig consumer's app ID Yes
appSecret string <DEFAULT> Nonfig consumer's app Secret Yes
cacheTtl number 60000 Cache time to live in milliseconds No

Usage

Retrieve single configuration

import { NonfigService } from '@nonfig/nestjs-config';


export class MyRepoService {
    constructor(private nonfig: NonfigService) {}

    async getPricing() {
        const name = '/path/to/pricing/config'
        return this.nonfig.findByName(name)
    }

}

export class MyFacadeService {

    constructor(private repo: MyRepoService) {}
    
    async applyPricing() {
        const config = await this.repo.getPricing()
        
        // write your code here to use pricingConfig
    }   

}

Retrieve multiple configurations

Example: Fetching the list of supported languages of application

// Application Controller
export class AppController {
    constructor(private service: AppService) {}

    @Get()
    async getLanguageList() {
        return this.service.getLanguageList()
    }   
}


import { NonfigService } from '@nonfig/nestjs-config';

//Application Service
export class AppService {

    constructor(private nonfig: NonfigService) {}

    async getLanguageList() {
        return this.nonfig.findByPath('/languages/list')
    }   

}

Retrieve configuration using ID

import { NonfigService } from '@nonfig/nestjs-config';

//Application Service
export class AppService {

    constructor(private nonfig: NonfigService) {}

    async getSpecificTranslation(id: string) {
        return this.nonfig.findById(id)
    }   

}

Retrieve multiple configurations using Labels

Example: Fetching the language of application using specific labels

// Application Controller
export class AppController {
    constructor(private service: AppService) {}

    @Get('language')
    async language(@Param('label') label: string) {
        return this.service.getLanguageByLabel(label.split(','))
    }   
}


import { NonfigService } from '@nonfig/nestjs-config';

//Application Service
export class AppService {

    constructor(private nonfig: NonfigService) {}

    async getLanguageByLabel(label: string[]): Promise<Languages[]> {
        return this.nonfig.findByLabels<Language>(label)
    }   

}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].