Skip to content

Growthbook - Feature Flags Display Tab Plugin#7800

Open
zaki-hanafiah wants to merge 17 commits intobackstage:mainfrom
zaki-hanafiah:growthbook-flags-plugin
Open

Growthbook - Feature Flags Display Tab Plugin#7800
zaki-hanafiah wants to merge 17 commits intobackstage:mainfrom
zaki-hanafiah:growthbook-flags-plugin

Conversation

@zaki-hanafiah
Copy link

@zaki-hanafiah zaki-hanafiah commented Feb 26, 2026

Hey, I just made a Pull Request!

This adds a new Growthbook Plugin workspace with the frontend and backend plugins.

This plugin will add a "Feature Flags" tab to Backstage catalog entity pages for any entity annotated with growthbook.io/enabled: "true". You can also use the growthbook.io/project: 'my-project-name' to scope it to one project only.
I have also included a standalone entity page that can be used if needed (GrowthbookEntityPage.tsx).


image

Other basic features for the frontend include:

  • Feature flag table with type badges (boolean, string, number, json) and default values
  • Project filter button group (fetched dynamically from the user's projects found from Growthbook API)
  • JSON detail dialog for expanding the view of more complex / nested flag values

The backend plugin serves as a proxy/cache layer between Backstage and GrowthBook:

  • Management API mode (when secretKey is configured / available): full project filtering and additional feature metadata via /api/v1/features + /api/v1/projects - More Info
  • SDK API fallback mode: uses public GrowthBook SDK endpoint when no secret key is set
  • 60-second flag cache, 5-minute project cache
  • Exposes /api/growthbook-flags/flags and /api/growthbook-flags/projects with unauthenticated auth policy (read-only viewer, seems like this is how it's setup with other community-plugins, correct me if im wrong 🙏🏻 (

✔️ Checklist

  • A changeset describing the change and affected packages
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message

@backstage-goalie
Copy link
Contributor

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage-community/plugin-growthbook-backend workspaces/growthbook-flags/plugins/growthbook-backend minor v0.1.0
@backstage-community/plugin-growthbook workspaces/growthbook-flags/plugins/growthbook minor v0.1.0

@backstage-goalie
Copy link
Contributor

Thanks for the contribution!
All commits need to be DCO signed before they are reviewed. Please refer to the the DCO section in CONTRIBUTING.md or the DCO status for more info.

Zaki Hanafiah and others added 17 commits March 2, 2026 03:25
Signed-off-by: Zaki Hanafiah <zaki@zakhov.com>
Signed-off-by: Zaki Hanafiah <zaki@zakhov.com>
Signed-off-by: Zaki Hanafiah <zaki@zakhov.com>
Signed-off-by: Zaki Hanafiah <zaki@zakhov.com>
Signed-off-by: Zaki Hanafiah <zaki@zakhov.com>
Signed-off-by: Zaki Hanafiah <zaki@zakhov.com>
Signed-off-by: Zaki Hanafiah <zaki@zakhov.com>
Signed-off-by: Zaki Hanafiah <zaki@zakhov.com>
… plugin with deps

Signed-off-by: Zaki Hanafiah <zaki@zakhov.com>
Signed-off-by: Zaki Hanafiah <zaki@zakhov.com>
Signed-off-by: Zaki Hanafiah <zaki@zakhov.com>
Signed-off-by: Zaki Hanafiah <zaki@zakhov.com>
Signed-off-by: Zaki Hanafiah <zaki@zakhov.com>
Signed-off-by: Zaki Hanafiah <zaki@zakhov.com>
Signed-off-by: Zaki Hanafiah <zaki@zakhov.com>
Signed-off-by: Zaki Hanafiah <zaki@zakhov.com>
Signed-off-by: Zaki Hanafiah <zaki@zakhov.com>
@Sarabadu
Copy link
Contributor

Sarabadu commented Mar 1, 2026

Hey @zaki-hanafiah looking forward for trying this new plugin, but seems like you need a rebase as the changes triggered every workspace

@zaki-hanafiah
Copy link
Author

Hey @zaki-hanafiah looking forward for trying this new plugin, but seems like you need a rebase as the changes triggered every workspace

hi @Sarabadu
yep, i made a mess earlier trying to pull latest main from upstream, have cherry-picked and rebased, thanks

Copy link
Contributor

@awanlin awanlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contirbution @zaki-hanafiah, nice work overall, left a few comments the vast majority are simple things.

Additonally you need to add yourself as to the CODEOWNERS file - https://github.com/backstage/community-plugins/blob/main/.github/CODEOWNERS - and also submit a request to become an Org Member here: https://github.com/backstage/community/issues/new?template=org_member.yaml

Once this PR is merged and release I would recommend following this up with a PR to add support for the New Frontend System, docs on that are here: https://backstage.io/docs/frontend-system/building-plugins/index

'@backstage-community/plugin-growthbook-backend': minor
---

Initial release of GrowthBook feature flags plugin for Backstage.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be shorted to just this line and a note to see the README for more details 👍

changesets get rolled up into a changelog and we want to keep them short and concise.


http.use(handler);
http.addAuthPolicy({ path: '/flags', allow: 'unauthenticated' });
http.addAuthPolicy({ path: '/projects', allow: 'unauthenticated' });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you doing this? This seems like a security risk.

@@ -13,11 +13,3 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect to see: export {}; at the end of this file otherwise I'm not sure why it's needed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this file, it will be created by the release process and should not be touched by hand 👍

* GrowthBook Management API secret key (read-only).
* When present, flags are fetched via the Management API with full project and environment metadata.
* When absent, the SDK API fallback is used and sdkKeys must be provided.
* @visibility backend
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @visibility backend
* @visibility secret

This is a secret and should be marked as such.

"private": true,
"engines": {
"node": "22 || 24"
"node": "20 || 22"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"node": "20 || 22"
"node": "22 || 24"

"node-gyp": "^10.0.0",
"prettier": "^2.3.2",
"typescript": "~5.8.0"
"typescript": "~5.3.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"typescript": "~5.3.0"
"typescript": "~5.8.0"

- **[@backstage-community/plugin-growthbook](./plugins/growthbook/README.md)**: Frontend plugin providing UI components and entity page integration
- **[@backstage-community/plugin-growthbook-backend](./plugins/growthbook-backend/README.md)**: Backend plugin providing API proxy and caching

## Getting Started
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To save on maintenance I would just point people to the proper README files instead, with this approach you have duplication to maitain.


export type FlagType = 'boolean' | 'number' | 'string' | 'json' | 'null';

export type FlagRow = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FlagRow and FlagType are used by both the frontend and the backend, I would create a common package to store these to avoid duplicaiton.

/**
* Base URL of your GrowthBook instance.
* @example https://app.growthbook.io
* @visibility frontend
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have this marked as frontend but best I can tell it's not being used in the frontend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants