Sign up for Foff
Go to foff.twospoon.ai and create an account using your email address. Foff sends a one-time passcode to your inbox — enter it to complete sign-in.
Create a workspace
After signing in, you are prompted to create a workspace. A workspace is the top-level container for all your feature flags and configuration. Give it a name that reflects your organization or product, then click Create workspace.Your new workspace appears in the top-left of the navigation bar. All the scopes and features you create are scoped to this workspace.
Create a scope
Select Scopes from the navigation bar, then click New scope.A scope defines the hierarchy shape that all its feature flags will follow. For this guide, use an organizational hierarchy:
Name the scope something descriptive — for example,
| Level | Example value |
|---|---|
| Company | zomato |
| Department | online-ordering |
| Team | riders |
| User | user-123 |
employee-hierarchy — then save it. Foff displays the scope’s detail page once it is created.Create a feature flag
Navigate to the Features section inside your scope and click New feature.For this guide, create a flag called
dark-mode-ui with a boolean default value of true. This default applies to every user unless a more specific override exists.After saving, the feature appears in your scope’s feature list with its default value displayed.Add a hierarchy override
Click Add override on the
dark-mode-ui feature.Overrides let you return a different value for a specific path through your hierarchy. To disable dark mode for everyone in the Zomato → Online Ordering → Riders path, set:- Company:
zomato - Department:
online-ordering - Team:
riders - Value:
false
Generate an API key
Click Developers in the navigation bar, then click Generate API key. Give the key a descriptive name (for example,
local-dev) and click Create.You can manage all your keys from the Developers section: enable or disable a key, or restrict it to specific IP addresses.Read your feature flag
Create a client using the API key you generated and the scope name you created earlier, then call The SDK fetches all configs for your scope on startup and caches them in memory.
getFeatureConfig with the feature name and the hierarchy path you want to resolve.getFeatureConfig resolves the hierarchy from most specific to least specific:zomato + online-ordering + riders— matches the override → returnsfalse- If no match, falls back to
zomato + online-ordering, thenzomato - If no override matches at any level, returns the feature’s default value
true is returned:For long-lived processes such as an Express server, create the client once at startup and call
client.close() on process exit to stop background polling. See the SDK reference for lifecycle patterns and all configuration options.