Agora

You're viewing the docs for Flags 0.x. The latest is 1.x (rc). Go to the 1.x (rc) docs

Flags

Typed feature flags, percentage rollouts, targeting and A/B experiments with real statistics — inside your AdonisJS app.

@adonis-agora/flags gives an AdonisJS app feature flags and experiments without a third-party service:

  • Flags are managed in the console: create them, target them, roll them out, without a deploy. They can also be declared in code, and node ace flags:types keeps console flags typed.
  • Evaluation is in memory. Every process keeps the ruleset and evaluates locally; reading a flag never waits on the database.
  • Experiments are measured. Exposures and conversions go through an outbox-style event log to your database, Parquet files, ClickHouse or PostHog, and the results page shows lift, confidence intervals, sample-ratio checks, CUPED and always-valid sequential p-values.
  • It grows with you. Start with Postgres/MySQL/SQLite. Add Parquet + DuckDB or ClickHouse when the event volume asks for it. Run a central flags server that many apps connect to, with authkit tokens.
  • It speaks OpenFeature, including OFREP for browsers, mobile apps and services in other languages.
// a controller
async show({ flags, inertia }: HttpContext) {
  if (await flags.enabled('new_player')) {
    return inertia.render('player/new')
  }
  return inertia.render('player/classic')
}
// an experiment
const variant = await ctx.flags.variant('checkout')        // records the exposure
await ctx.flags.track('purchase', { value: order.total })  // records the conversion

Packages

PackageWhat it is
@adonis-agora/flagsThe AdonisJS package: provider, config, commands, middleware
@adonis-agora/flags-reactuseFlag, <Flag>, live updates for Inertia/React
@adonis-agora/flags-dashboardThe console (installed with the main package)
@adonis-agora/flags-coreThe evaluation engine and statistics, framework-free

Next: Getting started.

On this page

Partner

Your product as the official integration for Flags, right here.

Become a partner →