Skip to content
@archipel/platform-feature-flags Auto-generated

@breadstone/archipel-platform-feature-flags

Classes

ClassDescription
AzureFeatureFlagReaderAzure App Configuration implementation of the FeatureFlagReaderPort. Uses @azure/app-configuration-provider for connecting to Azure App Configuration and @microsoft/feature-management for evaluating feature flags.
AzureFeatureFlagWriterAzure App Configuration implementation of the FeatureFlagWriterPort. Uses @azure/app-configuration (AppConfigurationClient) for CRUD operations on feature flags stored in Azure App Configuration.
FeatureFlagErrorDomain error thrown when a feature flag operation fails.
FeatureFlagGuardGuard that checks if a feature flag is enabled before allowing access to a route. Use the FeatureFlag decorator to specify which flag to check.
FeatureFlagModuleNestJS module providing feature flag infrastructure. Exposes a configurable feature flag reader and a route guard. Optionally exposes a writer port for CRUD operations when featureFlagWriter is provided. The specific provider (Azure App Configuration, Vercel Edge Config) is selected via the options.
FeatureFlagReaderPortAbstract port for feature flag reader operations. Each provider (Azure App Configuration, Vercel Edge Config) must implement this contract so that the consuming application can switch providers without changing business logic.
FeatureFlagWriterPortAbstract port for feature flag writer operations (CRUD). Each provider (Azure App Configuration, Vercel Edge Config) must implement this contract so that the admin UI backend can manage flags without being coupled to a specific provider.
VercelFeatureFlagReaderVercel Edge Config implementation of the FeatureFlagReaderPort. Uses @vercel/edge-config for reading feature flag state from a Vercel Edge Config store.
VercelFeatureFlagWriterVercel Edge Config implementation of the FeatureFlagWriterPort. Uses the Vercel REST API to manage feature flags stored in a Vercel Edge Config store.

Interfaces

InterfaceDescription
IFeatureFlagContextContext passed to feature flag evaluation for targeting and segmentation.
IFeatureFlagDefinitionRepresents a full feature flag definition for admin operations (create / update / read).
IFeatureFlagEvaluationResult of evaluating a single feature flag.
IFeatureFlagModuleOptionsConfiguration options for the FeatureFlagModule.

Variables

VariableDescription
AZURE_APPCONFIG_CONNECTION_STRINGAzure App Configuration connection string. Alternative to endpoint + Entra ID.
AZURE_APPCONFIG_ENDPOINTAzure App Configuration endpoint URL. Required when using Entra ID authentication.
AZURE_FEATURE_FLAG_CONFIG_ENTRIESConfiguration entries required by the Azure feature flag provider.
AZURE_FEATURE_FLAG_KEY_FILTERKey filter for selecting feature flags. Defaults to * (all).
AZURE_FEATURE_FLAG_REFRESH_INTERVALRefresh interval in milliseconds for feature flag state. Defaults to 30000.
FEATURE_FLAG_KEY_METADATAMetadata key used to store the feature flag key on route handlers.
PLATFORM_FEATURE_FLAGS_CONFIG_ENTRIESAll configuration entries required by the platform-feature-flags library across all providers.
VERCEL_API_TOKENVercel API token with write access to Edge Config. Required for write operations.
VERCEL_EDGE_CONFIGVercel Edge Config connection string (includes store ID and token).
VERCEL_EDGE_CONFIG_IDVercel Edge Config store ID. Required for write operations.
VERCEL_EDGE_CONFIG_TOKENOptional: Vercel Edge Config read access token (when not embedded in connection string).
VERCEL_FEATURE_FLAG_CONFIG_ENTRIESConfiguration entries required by the Vercel feature flag provider (read-only).
VERCEL_FEATURE_FLAG_PREFIXOptional: Prefix for feature flag keys in Edge Config. Defaults to featureFlags.
VERCEL_FEATURE_FLAG_WRITER_CONFIG_ENTRIESConfiguration entries required by the Vercel feature flag writer provider.
VERCEL_TEAM_IDOptional: Vercel Team ID for team-scoped API calls.

Functions

FunctionDescription
FeatureFlagDecorator to mark endpoints that require a specific feature flag to be enabled. The guard reads this metadata to evaluate the flag before allowing access.

Released under the MIT License.