import { getPayload } from 'payload' import config from '@payload-config' import { getAllFeatureFlags, isFeatureEnabled } from 'payload-feature-flags/rsc' export default async function HomePage() { const payload = await getPayload({ config }) const allFlags = await getAllFeatureFlags(payload) const activeCount = Object.keys(allFlags).length const isNewFeatureEnabled = await isFeatureEnabled('new-feature', payload) return (

Feature Flags Demo

Simple demonstration of the Payload CMS Feature Flags plugin

🚩
{activeCount}
Active Flags
{isNewFeatureEnabled ? '✅' : '❌'}
New Feature
{isNewFeatureEnabled ? 'Enabled' : 'Disabled'}
{isNewFeatureEnabled && (

🎉 Feature Flag Active

The "new-feature" flag is enabled! This content is only visible when the flag is active.

)}

Manage Feature Flags

Use the Payload admin panel to create and manage feature flags.

Open Admin Panel
) }