Brave Ship Feature Core - Pure, framework-agnostic feature flag evaluation logic
This package contains the central domain models and evaluation logic for the Brave Ship system. It is designed to be highly performant and used in both client-side and server-side environments.
import { Feature } from '@farmart-tech/brave-feature-core';const featureData = { enabled: true, releaseDate: '2024-01-01T00:00:00Z', rolloutStrategy: { type: 'percentage', config: { percentage: 50 } }};const context = { deviceContext: { deviceID: 'device-123' }, userContext: { userId: 'user-456' }, localFeatureContext: { ... }};const feature = new Feature(featureData, context);const isEnabled = await feature.getIsEnabled(); Copy
import { Feature } from '@farmart-tech/brave-feature-core';const featureData = { enabled: true, releaseDate: '2024-01-01T00:00:00Z', rolloutStrategy: { type: 'percentage', config: { percentage: 50 } }};const context = { deviceContext: { deviceID: 'device-123' }, userContext: { userId: 'user-456' }, localFeatureContext: { ... }};const feature = new Feature(featureData, context);const isEnabled = await feature.getIsEnabled();
Brave Ship Feature Core - Pure, framework-agnostic feature flag evaluation logic
This package contains the central domain models and evaluation logic for the Brave Ship system. It is designed to be highly performant and used in both client-side and server-side environments.
Example: Basic evaluation
See