A simple switch that lets you turn features on or off for specific users — no redeploy needed.
Imagine your app has a new feature — say, a fancy new dashboard. You've built it, but you're not sure if it's ready to show to everyone. What do you do?
With a feature flag, you flip a switch. On → people see the new dashboard. Off → they see the old one. You can change the switch any time, without rewriting code, without redeploying, without anyone waiting.
Switch ON
Users see the new dashboard.
Switch OFF
Users see the old dashboard.
In one sentence: A feature flag is a true/false switch in your app that decides whether to show a feature to a user.
Show a feature to yourself first
You built something new and you want to test it on the real site — but you don't want anyone else to see it yet. A flag lets you turn it on for just your account, while everyone else sees nothing.
Show a feature to a small group of testers
Pick 10 friendly users (or your team). Turn the flag on just for them. They use it, give you feedback, you fix the rough edges — then you flip it on for everyone.
Show a feature only to paying users
Some features should be paid-only. A flag tied to the user's plan keeps the "Pro" features visible to Pro users and hidden from everyone else.
You don't need any special tool to start. Just describe what you want and AI handles the rest. The trick is to tell AI three things:
The 3 things to tell AI
THE STARTER PROMPT
"Add a feature flag to my app called "new-dashboard". When it's ON, users see my new dashboard component. When it's OFF, they see the old one. For now, only show it to my own account (my email is [your@email.com]). Make it easy to flip on or off without redeploying — pick the simplest setup you can, no fancy services required."
Here are the most common ways people actually use feature flags. Pick whichever matches what you're building.
🧪 The "test it live" flag
You built a new homepage. You want to see it on your real domain (with real users around) but not actually launch it. Add a flag that shows the new homepage only when you're logged in as yourself.
ADD A "ME ONLY" FLAG
"Add a feature flag called "new-homepage". When ON, I see the new homepage I just built. When OFF, everyone sees the old one. Only my account ([your@email.com]) should ever see the new one for now — even when the flag is ON, hide it from everyone else."
👥 The "beta testers" flag
You have 10 friends willing to test a new feature. Make a list of their emails and only show the feature to those 10 people. Once they're happy, expand to everyone.
ADD A BETA TESTERS FLAG
"Add a feature flag called "beta-comments" for my new commenting feature. Show the comments section ONLY to users whose email is in this list: [email1, email2, email3]. Everyone else should see no comments at all. When I'm ready to launch to everyone, I want to be able to flip it on without redeploying."
💎 The "Pro users only" flag
You have a feature that's part of your paid plan. Use a flag to make sure only paying users see it.
ADD A PAID-ONLY FLAG
"Add a feature flag called "export-pdf" for my PDF export feature. Show the Export PDF button only to users on the Pro plan. Free users should not see the button at all — and if they somehow find the URL, redirect them to my pricing page."
For your first flags, the simple version works great. AI puts the on/off setting somewhere in your code or your hosting environment, and you flip it by changing one line.
But once you have 5+ flags and want to flip them from a dashboard without touching code, it's worth using a real flag tool. The most popular free option is PostHog. It gives you a web dashboard where you can flip any flag with a click.
✅ Stay simple if
⬆️ Upgrade to PostHog if
Forgetting to remove a flag once the feature is launched to everyone
Once your feature is on for 100% of users, the flag is just clutter. Tell AI: "remove the new-homepage flag — the feature is permanent now."
Adding a flag for things you'll never turn off
Don't flag every little change. Flags are for things you're unsure about, not for permanent features. If you'd never turn it off, just ship it directly.
Flag is on for me locally but off in production
Different environments have different settings. Tell AI: "make sure the flag value is the same on localhost and on Vercel, or show me where to set it for production."
Hiding a button is not the same as protecting a feature
If a feature uses paid data (like an AI call), hide the button AND block the underlying call on the server. Otherwise users could still trigger it directly.
You built a new dashboard but it's not quite ready. You want your two co-founders to be able to use it on the real site (so they can give feedback) — but everyone else should still see the old dashboard. With one prompt, AI adds a flag that uses your team's email addresses to decide who sees what.
Build this with AI
"Add a feature flag called "new-dashboard" to my app. Show the new dashboard ONLY to users whose email is in this list: [your@email.com, cofounder1@email.com, cofounder2@email.com]. Everyone else should still see the old dashboard. Make the email list easy for me to update later — keep it in one obvious place."
HIDE A FEATURE WHILE I FIX A BUG
"Something's broken with my [feature name]. Add a feature flag so I can hide that feature from everyone immediately. Don't delete the code — just hide the feature from users until I flip the flag back on after the fix."
SHOW A FEATURE TO 10% OF USERS
"I want to roll out my new search bar slowly. Add a feature flag that shows it to about 10% of users (random but consistent — the same user should always see the same version). Make it easy for me to bump that number up later."
LAUNCH SOMETHING ON A SPECIFIC DATE
"I want to announce my new pricing on January 15th. Set up a feature flag that automatically turns on the new pricing page on that date. Until then, everyone sees the old pricing."