Flagbearer
v1.0.1Feature flags for coding agents: create flags, roll them out gradually and write the flag code.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_organizations List organizations
List the Flagbearer organizations you belong to. Start here to find an organization's ID. This connection only covers the organizations listed. If the project's application isn't in any of them, tell the user before writing flag code, and ask them to reconnect and approve the right organization.
list_applications List applications
List the applications in an organization. Flags belong to an application.
| Parameter | Type | Description |
|---|---|---|
organizationId * | string |
create_application Create an application
Create an application in an organization, usually one per product or codebase, like Storefront. It comes with development, staging and production environments. Ask the user for the name if it isn't obvious from the project. Then create flags in it with create_flag, and a client key with create_client_key for browser and mobile code.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
organizationId * | string |
list_flags List flags
List an application's feature flags with whether each is on, and its rollout percent, in every environment.
| Parameter | Type | Description |
|---|---|---|
applicationId * | string |
create_flag Create a flag
Create a feature flag in an application. It starts off in every environment; use set_flag to turn it on. The key is what code checks, like new-checkout.
| Parameter | Type | Description |
|---|---|---|
applicationId * | string | |
description * | ||
key * | string | |
name * | string |
set_flag Turn a flag on or off
Turn a flag on or off in one environment, by flag key and environment key. When turning a flag on, rolloutPercent says who gets it: 100 for everyone, or a percentage of users. Ask the user whether it should be on for everyone. Without rolloutPercent it's 0, which turns it on only for the environment's testers. Changing production needs confirmProduction: true. Only send that after the user has confirmed the change.
| Parameter | Type | Description |
|---|---|---|
applicationId * | string | |
enabled * | boolean | |
environment * | string | |
flagKey * | string | |
confirmProduction | boolean | |
rolloutPercent | number |
generate_flag_types Generate typed flag keys
The text of a TypeScript file listing an application's flag keys, so a misspelled key is a type error and editors autocomplete keys. Write the returned text to the path exactly as it is, and commit it. Only for TypeScript projects using @flagbearer/web (React and browser apps), @flagbearer/node or @flagbearer/react-native. Call it when setting up flags in such a project, and again after creating a flag.
| Parameter | Type | Description |
|---|---|---|
applicationId * | string | |
sdks * | array | |
out | string |
get_user_flags Get a user's flags
What a user should have got for every flag in one environment, by email or user key, with the reason (off, tester or rollout and their bucket), what their SDK reported that UTC day (seen), and any changes that day that flipped their result. Use it when a bug report says a feature stopped working, or works for some users and not others. times is a list of ISO timestamps to show side by side, like before and after a report; leave it out for now. An email the SDK saw with several user keys gives one entry per key.
| Parameter | Type | Description |
|---|---|---|
applicationId * | string | |
environment * | string | |
user * | string | |
times | array |
get_sdk_docs Get SDK docs
The current Flagbearer SDK docs for a platform (react, react-native, ios, android, browser, node, python, go, java, dotnet, ruby, rust, cpp or php), plus one environment's SDK address and public client key. Call this before writing code that checks a flag, and follow it.
| Parameter | Type | Description |
|---|---|---|
applicationId * | string | |
environment * | string | |
platform * | string |
create_client_key Create a client key
Create a public client key for one environment, for browser and mobile SDKs (react, react-native, ios, android, browser). It's safe in app code. Each environment needs its own. Server SDKs need a secret server key instead, which only an admin can create in the Flagbearer dashboard.
| Parameter | Type | Description |
|---|---|---|
applicationId * | string | |
environment * | string | |
name | string |
check_sdk_setup Check SDK setup
What looks wrong with how an application's SDKs are set up, per environment, from what they sent in the last day: flags the code checks that don't exist, wrong or leaked keys, old SDK versions, and environments nothing has connected to. Call this when flags aren't behaving as expected, and after adding flag code and running the app.
| Parameter | Type | Description |
|---|---|---|
applicationId * | string |