UNPKG

nest-feature-guard

Version:

A powerful, NestJS-first feature flag guard and decorator library with Redis caching support. Perfect for implementing feature toggles, A/B testing, gradual rollouts, and user-specific feature access control.

14 lines (13 loc) 390 B
export interface SetFeatureFlagOptions { flag: string; enabled: boolean; userIds?: string[]; } export interface FeatureGuardStore { setFeatureFlag(options: SetFeatureFlagOptions): Promise<void>; getFeature(flag: string): Promise<{ enabled: boolean; userIds?: string[]; } | null>; hasFeatureFlag(flag: string, userId: string): Promise<boolean>; }