Skip to content

Conversation

@jdorn
Copy link
Contributor

@jdorn jdorn commented Jun 17, 2025

Changes

Currently in the GrowthBook adapter, flags are fetched once at server startup, stored in-memory, and never refreshed.

This PR changes it so that every time a flag is evaluated, we refresh in the background from either Edge Config or the GrowthBook API (depending on which one the adapter is configured to use).

New adapter options / methods

There is a new adapater method refresh() that can be called manually.

Testing

I tested in a new Next.js app with and without Edge Config and verified that features refreshed without requiring an app restart. Also verified that when not using Edge Config, an in-memory cache is used to throttle network requests.

Because of the stale-while-revalidate logic for both Edge Config and GrowthBook's built-in fetching, it may take an extra refresh for changes to be picked up.

@vercel
Copy link

vercel bot commented Jun 17, 2025

@jdorn is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@AAorris AAorris left a comment

Choose a reason for hiding this comment

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

Sorry for the delay here! It looks good to me.
Could you add a changeset pnpm changeset before merging?

@vercel
Copy link

vercel bot commented Nov 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
flags-sdk-next-15 Ready Ready Preview Comment Nov 7, 2025 0:37am
flags-sdk-next-16 Ready Ready Preview Comment Nov 7, 2025 0:37am
flags-sdk-snippets Ready Ready Preview Comment Nov 7, 2025 0:37am
flags-sdk-sveltekit-snippets Ready Ready Preview Comment Nov 7, 2025 0:37am
shirt-shop Ready Ready Preview Comment Nov 7, 2025 0:37am

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants