Skip to content
5 changes: 5 additions & 0 deletions .changeset/header-driven-vercel-mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vercel/flags-core": minor
---

Add a header-driven `vercel` client mode that uses timestamps from the `x-vercel-flags-config-versions` or `flags-config-versions` request header instead of streaming or polling. Reuse fresh definitions, refresh in the background when the request version is up to 10 seconds newer than the cached configuration, and block for a refresh when the gap is larger. Deduplicate concurrent refreshes, allow retries after fetch failures, and discard late responses after shutdown.
5 changes: 5 additions & 0 deletions packages/vercel-flags-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ const client = createClient(process.env.FLAGS!, {
This option is sent only to the metrics ingestion endpoint. It does not select
the environment used for flag evaluation.

## Configuration version headers

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

i'd leave it out of the README, this is way too deep in the weeds


The header source reads `x-vercel-flags-config-versions` or `flags-config-versions`,
with the `x-vercel-` header taking precedence when both are present.

## OpenFeature

An OpenFeature-compatible provider is available at `@vercel/flags-core/openfeature`:
Expand Down
Loading
Loading