BuildBaseBuildBase

Overview

Gate features by subscription plan or target specific users for beta rollouts.

BuildBase provides two types of feature flags. Workspace features are tied to plans — upgrade to Pro and get analytics. User features target specific users — assign users directly, or target them through user lists or audience lists.

import {
  WhenUserFeatureEnabled,
  WhenWorkspaceFeatureDisabled,
  WhenWorkspaceFeatureEnabled,
} from '@buildbase/sdk/react';

function Dashboard() {
  return (
    <>
      <WhenWorkspaceFeatureEnabled slug="advanced-analytics">
        <AdvancedAnalytics />
      </WhenWorkspaceFeatureEnabled>

      <WhenWorkspaceFeatureDisabled slug="advanced-analytics">
        <p>Upgrade to Pro for analytics.</p>
      </WhenWorkspaceFeatureDisabled>

      <WhenUserFeatureEnabled slug="beta-editor">
        <NewEditor />
      </WhenUserFeatureEnabled>
    </>
  );
}

Before you start

Create feature flags in the BuildBase dashboard. Workspace features are configured per plan. User features are targeted to individual users, user lists, or audience lists.

Components

ComponentRenders when
WhenWorkspaceFeatureEnabledWorkspace feature is on (tied to plan)
WhenWorkspaceFeatureDisabledWorkspace feature is off
WhenUserFeatureEnabledUser feature targets the current user (directly, or via a user or audience list)
WhenUserFeatureDisabledUser feature does not target the current user

All take a slug prop (the feature identifier from the dashboard) and children.

Combining with other components

Feature flags compose naturally with permissions, subscriptions, and credits:

import {
  Permission,
  WhenCreditsAvailable,
  WhenPermission,
  WhenWorkspaceFeatureEnabled,
} from '@buildbase/sdk/react';

function AISection() {
  return (
    <WhenWorkspaceFeatureEnabled slug="ai-generation">
      <WhenPermission permission={Permission.WORKSPACE_BILLING_MANAGE}>
        <WhenCreditsAvailable min={10}>
          <GenerateButton />
        </WhenCreditsAvailable>
      </WhenPermission>
    </WhenWorkspaceFeatureEnabled>
  );
}

Pre-built features screen

openWorkspaceSettings('features') shows a built-in screen where workspace admins can toggle user-managed feature flags.

Limitations and behavior

BehaviorDetail
Toggle sourceUser-managed workspace features toggle via updateFeature(workspaceId, key, value) on useSaaSWorkspaces() or bb.features.update(workspaceId, key, value) server-side. Plan-tied workspace features follow the plan, and user feature targeting is dashboard-only
PropagationChanges take effect on the next page load or session refresh (not instant for active sessions)
CachingFlags are fetched with the session data and cached locally. No additional API calls per render
RollbackDisabling a flag hides gated UI immediately on next load. Running code is not interrupted
AnalyticsNo built-in A/B analytics — you must track conversions yourself (e.g. via workflows or your own analytics)
NestingFeature flag components can be nested with permission and subscription gates — they compose naturally

Next Steps

  • Permissions — Role-based access control.
  • Billing — Tie features to subscription plans.