Documentation Index
Fetch the complete documentation index at: https://docs.auction-rise.com/llms.txt
Use this file to discover all available pages before exploring further.
Feature Flags
Feature flags let you ship code dark, roll out to specific workspaces, or gate features by subscription plan — all without redeploying.How Flags Work
Each flag has three resolution layers checked in order:- Workspace override — a workspace-specific
true/falsestored in theworkspace_overridesJSONB column. Overrides the global state for that workspace. - Plan-based gating — (hook point, not yet implemented) check the workspace’s active plan against
plan_ids. - Global default —
enabled_globallyboolean on the flag row.
Checking a Flag
FeatureFlagProvider and the useFlag() hook (build these on top of getFlags() if needed).
Flag Schema
Managing Flags
Super admins manage flags via the admin panel or directly via server actions:Creating a New Flag
Add a row to thefeature_flags table:
checkFlag("new-dashboard", workspaceId).
Plan-Based Gating
Theplan_ids column is reserved for subscription-based gating. To implement it, extend the checkFlag() function in lib/flags/actions.ts to look up the workspace’s active plan from your subscriptions table and return true if the plan ID is in flag.plan_ids.
The hook point is already in the code as a TODO comment in
checkFlag(). Wire it up after you have subscription records in your database.RLS
Thefeature_flags table uses RLS: all authenticated users can read flags, only super admins can write. This lets you safely call getFlags() from any authenticated server component without leaking sensitive state.