litestar-flags¶
Ship features with confidence. Production-ready feature flags for Litestar with percentage rollouts, A/B testing, user targeting, and time-based scheduling.
Memory, Redis, and SQLAlchemy storage backends. Choose what fits your infrastructure.
Gradually release features to a subset of users. Roll back instantly if issues arise.
Built-in variant support for experimentation. Measure impact with confidence.
Target specific users, groups, or segments. Personalize experiences at scale.
Schedule launches, maintenance windows, and recurring availability patterns.
Vendor-agnostic feature flagging via the OpenFeature standard.
Quick Start¶
from litestar import Litestar, get
from litestar_flags import FeatureFlagsPlugin, FeatureFlagsConfig, FeatureFlagsClient
config = FeatureFlagsConfig()
plugin = FeatureFlagsPlugin(config=config)
@get("/")
async def index(feature_flags: FeatureFlagsClient) -> dict:
if await feature_flags.is_enabled("dark_mode"):
return {"theme": "dark"}
return {"theme": "light"}
app = Litestar(plugins=[plugin])
Full type hints with msgspec validation. Catch errors before they reach production.
Works out of the box with sensible defaults. Customize when you need to.
Built for async from the ground up. No blocking operations.
Minimal dependencies. Install only the backends you need.
Installation, configuration, and your first feature flag in minutes.
Step-by-step guides for rollouts, testing, targeting, and more.
Complete documentation for all modules, classes, and functions.