OpenFeature NestJS SDK
Overview
The OpenFeature NestJS SDK is a package that provides a NestJS wrapper for the OpenFeature Server SDK.
Capabilities include:
- Providing a NestJS global module to simplify OpenFeature configuration and usage within NestJS
- Setting up logging, event handling, hooks and providers directly when registering the module
- Injecting feature flags directly into controller route handlers by using decorators
- Injecting transaction evaluation context for flag evaluations directly from execution context (HTTP header values, client IPs, etc.)
- Injecting OpenFeature clients into NestJS services and controllers by using decorators
Quick start
Requirements
- Node.js version 18+
- NestJS version 8+
Install
npm
npm install --save @openfeature/nestjs-sdk
yarn
# yarn requires manual installation of the peer dependencies (see below)
yarn add @openfeature/nestjs-sdk @openfeature/server-sdk @openfeature/core