DocsOverviewQuick StartFrameworksDeploymentsDomainsEnv VarsFeature FlagsAI GatewayAPI ReferenceWebhooks

Feature Flags

Feature flags

Ship features to a subset of users, run A/B tests, and gradually roll out changes — all without redeploying. Feature flags are evaluated server-side with zero latency overhead.

Key concepts

Flag

A named boolean or multivariate toggle. Flags have a key (e.g. new-checkout-flow) and one or more variants (on/off or custom string values).

Rule

A targeting rule determines which users see which variant. Rules are evaluated top-to-bottom; the first match wins.

Rollout

Serve a variant to a percentage of users. Deploxa uses consistent hashing so the same user always gets the same variant.

Override

Force a specific user or org to always see a specific variant — useful for internal testing or beta access.

Creating a flag

Navigate to Project → Feature Flags → New Flag. Set a key, description, and default variant. The key is what you use in code to evaluate the flag.

Keynew-checkout-flow
TypeBoolean (on/off)
Default variantoff
Status
Active

Evaluating flags in your app

Use the Deploxa REST API or a thin SDK wrapper to evaluate flags at runtime. Pass a user context object so targeting rules can be applied.

Node.js / TypeScript

import { DeployxaClient } from "@deploxa/flags"; const client = new DeployxaClient({ apiKey: process.env.DEPLOXA_FLAGS_KEY, }); const user = { id: "user_123", email: "alice@example.com", plan: "pro" }; // Boolean flag const showNewCheckout = await client.isEnabled("new-checkout-flow", user); if (showNewCheckout) { // Render the new checkout flow }

Python

from deploxa import FlagsClient client = FlagsClient(api_key=os.environ["DEPLOXA_FLAGS_KEY"]) user = {"id": "user_123", "email": "alice@example.com", "plan": "pro"} show_new_checkout = client.is_enabled("new-checkout-flow", user) if show_new_checkout: # Render the new checkout flow

REST API (curl)

curl -X POST https://deploxa.app/api/v1/flags/evaluate \ -H "Authorization: Bearer $DEPLOXA_FLAGS_KEY" \ -H "Content-Type: application/json" \ -d '{ "flag": "new-checkout-flow", "user": { "id": "user_123", "plan": "pro" } }' # Response: # { "flag": "new-checkout-flow", "variant": "on", "reason": "rule:beta-users" }

Targeting rules

Rules are evaluated in order. The first rule that matches the user context wins and returns the configured variant. If no rule matches, the default variant is returned.

Example rules for "new-checkout-flow"

1
user.email ends with @acme.com→on

Internal team always sees the new flow

2
user.plan = pro→on

Pro users in the beta

3
10% rollout→on

Gradual rollout to 10% of free users

4
Everyone else→off

Default — sees the old checkout

A/B testing

Multi-variant flags support A/B and multivariate tests. Assign percentages to each variant — they must sum to 100%. Deploxa uses consistent hashing on user ID so assignments are sticky.

Flag: checkout-button-color

blue
50%
green
30%
orange
20%

Track conversion metrics per variant using analytics events. See the Analytics API for event tracking.

What you can target

User ID (stable hashing)
Email address or domain
Organization / workspace
Subscription plan
Country / region
Custom attributes (any string/number)
Percentage rollout
Specific user or org overrides
Env VariablesAI Gateway