- Switch something off fast. Something broke after a release? Turn its flag off and each user stops getting it as soon as their app opens or comes back to the foreground.
- Roll out step by step. Start a new feature at 10% of your users and raise it as the numbers hold up.
- Give early access. Turn a feature on only for your team, your testers, or customers you choose by email.
- Change a value without a build. Send a price, a piece of copy or a limit with the flag, and change it from Newly.
newly flags command in your terminal. All three change the same flags, and each change is kept in the flag’s history.
Add flags to your app
1
Ask the agent
Open Feature flags and select Add to my app, or ask in the chat: Add feature flags to my app. The agent asks which feature to put behind a flag, adds flag support to your app, puts the feature behind the flag, and creates the flag, off.
2
Check the flag
The new flag appears in Feature flags, under Development. Its history shows Agent as who created it.
3
Try it in your preview
Turn the flag on in Development. Leave your app’s preview and come back to it (or reopen it), and it shows the feature. Turn it off and the feature goes away.
4
Go live
When you’re ready for real users, create the same flag in Production and turn it on there, for everyone or for a group first. See Who gets it.
A flag that your app has never heard from (for example, the very first launch with no internet) counts as off. That’s why the agent always keeps the old behaviour working behind the flag.
Development and Production
Every flag exists separately in Development and Production, each with its own app key. Your app picks the right one by itself:
So you can try a flag in your preview without touching what your users get. Never copy a key into your code or switch environments by hand. The app chooses for you.
App keys
The strip at the top of Feature flags shows the app key for the environment you’re looking at. Your app reads its flags with this key. It is public by design, like a publishable payment key: it can only read this app’s flags, never change them.- Copy copies the key.
- Create key appears only when the environment has no key yet.
- Rotate replaces the key. Builds that still carry the old key stop reading flags and fall back to each flag’s default (off) until you ship a build with the new key. Only rotate a key if you need to.
The flag list
Each row shows:- the flag’s key (its name in your code) and description;
- who gets it, for example Staff + 25% of everyone, or No one (off);
- who changed it last (In Newly, Agent or CLI) and when; select it to open the history;
- the on/off switch. It saves at once.
Who gets it
A flag is on for a user when it’s switched on and at least one of its groups matches that user.- A group has a name, filters, and a Roll out to percentage.
- Any one group is enough. Groups are joined by OR.
- Every filter in a group must match. Filters are joined by AND.
- Any one value in a filter is enough. A filter can hold several values, shown as chips joined by or. Is not works the other way: the user must match none of its values, so
User ID is not a, bleaves out both. - A group with no filters is everyone.
- A new flag starts with one group, Everyone at 100%.
With one of: is, is not, contains, starts with, ends with. Capital letters don’t matter. A filter only matches users who send that information, so is not never matches a user who has no email or property at all.
Examples
Roll out to
Each group has its own Roll out to percentage. Every user always lands in the same spot for a flag, so they don’t flip between on and off. Raising the percentage only adds users: nobody who already has the feature loses it.Value sent with it
You can attach a short text value (up to 4 KB) to a flag, such as{"button": "Pay with Apple Pay"}. Your app gets it only while the flag is on for that user. Use it for copy, prices or limits you want to change without a build.
History
Every change to a flag is kept: who made it (In Newly, Agent or CLI), when, and what changed (turned on or off, who gets it, the value, the description). History is kept even after a flag is deleted.Use the agent
The agent can do everything the Feature flags tab does. Ask it in the chat, for example:- Put the new onboarding behind a flag.
- Turn on new-checkout for our team only.
- Roll dark-mode out to 25% of users in production.
- Turn off holiday-banner everywhere.
- Who changed new-checkout last?
Use the CLI
Thenewly flags commands work from your app’s folder. Every command works on Development unless you add --env prod, so you never change what your users get by accident.
Set who gets a flag with
--group (you can repeat it) and --rollout:
name:rollout:filters. Filters are joined with and, and values with commas. --rollout 25 adds an Everyone group at 25%.
Pricing
Each app gets 1,000,000 flag reads free every month, counted from the 1st, UTC. Reads from Development and Production builds count together. Past the free million, reads cost 20 credits per million reads.- One read is your app asking for its flags: when it opens, and when it comes back to the foreground, at most once a minute. One read covers every flag at once.
- An app with 10,000 people using it daily, each opening it or coming back to it about six times a day, makes roughly 1.8 million reads a month, so about 16 credits past the free million.
- Reads are charged every hour, a little after the hour ends.
- Flags keep working when you run out of credits. Your app is never cut off. Add credits to keep your balance positive.
- Account, Usage: Feature flag reads this month lists each app’s reads against its free million. Charges show under By area as Feature flags.
- Feature flags: the strip above your flags shows this app’s reads this month.
- Reserved credits: you can reserve credits for Feature flags. Like Backend, a reserve here only warns you by email at 90% and 100%. It never stops your flags.
Troubleshooting
I don't see Feature flags in Marketing & analytics
I don't see Feature flags in Marketing & analytics
Feature flags is rolling out, and the tab only appears on accounts that have it. Open a cloud project, then Marketing & analytics, Release, Feature flags.
I turned a flag on but my app didn't change
I turned a flag on but my app didn't change
- Leave the app and come back to it, or reopen it. Apps refresh their flags when they open and when they return to the foreground, at most once a minute.
- Check the environment. Your preview and development builds read Development; TestFlight, App Store, Google Play and downloaded APKs read Production. A flag turned on only in Development won’t show in a TestFlight build.
- Check who gets it. A group with filters only matches users who send that information. Email filters match only signed-in users; a User ID filter matches the device’s own ID when nobody is signed in.
- Check that the app reads the same key as the flag (open the flag; its key is the name in your code).
My group matches no one
My group matches no one
Two filters on the same thing (for example two Email filters) must both match. To match either value, put both values in one filter. The editor shows Merge into one filter when it spots this.
Some users get the feature and others don't
Some users get the feature and others don't
That’s the Roll out to percentage doing its job. Each user always gets the same answer. Set it to 100% for everyone in that group.
My app stopped reading flags after I rotated the key
My app stopped reading flags after I rotated the key
Builds with the old key fall back to each flag’s default (off) until they ship with the new key. Run
newly flags init (or ask the agent to update the flag keys) and ship a new build.I was charged for feature flag reads
I was charged for feature flag reads
Each app gets a million reads free each month, counting Development and Production together. Past that, reads cost 20 credits per million. Account, Usage, Feature flag reads this month shows each app’s reads. Reads come from app launches and returns to the app, so an app with many daily users reads more.
Can I use a flag to hide something secret or paid?
Can I use a flag to hide something secret or paid?
No. A flag decides what your app shows, but the user’s email and properties come from the app itself, so it isn’t a security check. Protect paid features and private data on your server.