API Reference

Complete API documentation for litestar-flags. This reference covers all public classes, functions, and types available in the library.

Tip

For getting started guides and tutorials, see the Getting Started section. This reference is intended for detailed API lookups.

Core Components

The main components you will use most frequently:

  • Client - The FeatureFlagClient for evaluating feature flags

  • Configuration - Configuration and plugin setup

  • Context - The EvaluationContext for targeting rules

Decorators

Convenient decorators for protecting route handlers:

  • Decorators - @feature_flag and @require_flag decorators

Storage Backends

Available storage backend implementations:

Types and Enums

Type definitions and enumerations:

Exceptions

Exception classes for error handling:

  • Exceptions - Error classes for feature flag operations

Models

Data models for flags, rules, and variants:

  • Models - FeatureFlag, FlagRule, FlagVariant, and more