value, a flag is on or off and starts off. With a schema, it holds any value the schema accepts, starting at default, and pult build checks the default is valid.
Reading a flag
- A value set for that record, if the flag has a
target. - The first rule whose conditions match the attributes you passed.
- A rollout, for on and off flags: a share of keys that get it, always the same ones, so raising the share only adds people and lowering it only takes away the most recent.
- The environment’s value.
- The flag’s
default, if nothing’s been set or the stored value no longer fits the schema.
pult.listen(), changes arrive over the connection within a moment. Without it, on serverless platforms, the SDK checks at most every ten seconds, and the check costs almost nothing when nothing changed. If Pult can’t be reached, your app keeps the last values it saw, or the defaults.
Rules
attributes describes what your app can tell Pult about whoever’s asking: their plan, their country, how many seats they have. Your team then writes rules in the console, like “plan is pro or team: on” or “seats above 50: on for 20%”. Rules are checked in order and the first match wins. A condition on an attribute your app didn’t pass doesn’t match, except “is not”.
Pult never sees these attributes. They’re compared in your app, against rules it already has.
Changing gradually
Any on and off flag, and any flag holding a number, can move to a new value over time instead of all at once. Pick where it should end up and how:- Over a period: “to 100% over 5 days”, moving smoothly or in steps, like once a day.
- Step by step: “10% more every hour” until it gets there.
Guards
guard ties a flag to an inbox. While the flag is moving, if that inbox gets perHour items or occurrences within an hour, Pult stops the ramp where it is, or with then: "revert" puts it back where it started. The audit log says what happened and why. With a guard on your crashes inbox, a rollout that starts breaking things stops itself before it reaches everyone.
Your app works out where a ramp is from the clock, so nothing has to reach it at each step. A ramp that needs approval starts once it’s approved.
In the console
Flags have their own page in the sidebar. On and off flags have a switch; others show their value with a button to change it. More opens rollouts, gradual changes and values for specific records, picked by search like any record.danger and approval work as they do for actions: a confirmation, a fresh sign-in, or a second person before the change happens. Every change is in the audit log with its before and after.
Each environment has its own values. Changing a flag in staging doesn’t touch production.
Every flag shows how often your app read it and when it last did, so flags nobody reads any more are easy to spot and remove.
To put a flag on a page or a record, use b.flag(newEditor).
Who can change a flag
Everyone can see flags and their values. Changing one is granted in roles withflags, and admins can change all of them.