Files
Bas van den Aakster bca558fad3 Update Payload dependencies to 3.56.0 and implement DefaultTemplate layout
- Updated all @payloadcms/* dependencies from 3.37.0 to 3.56.0
- Implemented DefaultTemplate from @payloadcms/next/templates with proper props structure
- Fixed TypeScript compilation by adding proper Locale type import
- Feature flags admin interface now wrapped in PayloadCMS default admin layout with navigation sidebar
- Verified build process works with updated dependencies

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 16:38:31 +02:00
..
2025-09-28 18:19:36 +02:00

Demo Environment

Simple demo for testing the feature flags plugin.

Quick Start

pnpm install
pnpm dev
# Visit http://localhost:3000

URLs:

Login

Admin: dev@payloadcms.com / test (full access)
Editor: editor@payloadcms.com / test123 (limited access)
User: user@payloadcms.com / test123 (read-only)

What's included

Homepage: Shows feature flag status and demo content
Admin Panel: Manage feature flags and users
Sample Data: One test feature flag ready to use

Testing the Plugin

  1. Check the homepage - See the feature flag in action
  2. Login to admin - Use admin credentials above
  3. Toggle the flag - Go to Feature Flags collection
  4. Refresh homepage - See content appear/disappear

Plugin Config

payloadFeatureFlags({
  enableRollouts: true,    // Percentage rollouts
  enableVariants: true,    // A/B testing
  defaultValue: false,     // New flags start disabled
  // + custom fields and permissions
})

API Testing

The plugin uses Payload's native REST API:

# Get all flags
curl http://localhost:3000/api/feature-flags

# Query specific flag
curl 'http://localhost:3000/api/feature-flags?where[name][equals]=new-feature'

# Get only enabled flags
curl 'http://localhost:3000/api/feature-flags?where[enabled][equals]=true'

Database

Uses in-memory MongoDB - no setup needed! Data resets on each restart.

Creating New Flags

  1. Login to /admin/collections/feature-flags
  2. Click "Create New"
  3. Add name, description, and toggle enabled/disabled
  4. Check the homepage to see it working

Need Help?

  • Check the console for error messages
  • Make sure port 3000 is available
  • Try logging in as admin user

Next Steps

Ready to use this in your project?

  1. Add to your project: Copy the plugin config
  2. Customize: Add your own fields and permissions
  3. Go live: Use a real MongoDB database
  4. Monitor: Track how your flags perform

This demo gives you everything needed to test feature flags with zero setup.