Skip to content

Fall back to the OIDC project in getProviderData before activation - #602

Merged
luismeyer merged 1 commit into
mainfrom
luismeyer/provider-data-before-activation
Nov 17, 2026
Merged

luismeyer merged 1 commit into
mainfrom
luismeyer/provider-data-before-activation

Conversation

@luismeyer

Copy link
Copy Markdown
Member

Problem

A project has no datafile until Vercel Flags is activated (its first flag is created). getProviderData from @flags-sdk/vercel fetches the datafile to learn the project ID of OIDC flags, so before activation the fetch returns 404 and the discovery endpoint fails with a 500. Flags Explorer then shows "Missing version information".

On Vercel, #595 already fixes this: the origin of OIDC clients names the project from VERCEL_PROJECT_ID, so the lookup does not run. Locally, vercel env pull writes only VERCEL_OIDC_TOKEN, so the lookup still runs and fails.

Change

As a fallback, when both the bundled definitions and the datafile fail, flags that use OIDC (no SDK key) take the project ID from the project_id claim of VERCEL_OIDC_TOKEN. Flags with an SDK key still throw, since the key can belong to another project. The token is not verified, because the ID only labels the origin.

Tests

  • falls back to the project of the OIDC token (fails without the fix)
  • throws when the OIDC token names no project
  • does not fall back for an SDK key

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
flags-playground Ready Ready Preview, v0 Nov 16, 2026 12:36pm UTC
shirt-shop Ready Ready Preview, v0 Nov 16, 2026 12:36pm UTC
shirt-shop-api Ready Ready Preview, v0 Nov 16, 2026 12:36pm UTC

@luismeyer
luismeyer merged commit 75fa303 into main Nov 17, 2026
31 checks passed
@luismeyer
luismeyer deleted the luismeyer/provider-data-before-activation branch November 17, 2026 08:28
@github-actions github-actions Bot mentioned this pull request Nov 17, 2026

This branch was successfully deployed

14 active deployments
Preview – flags-sdk-dev — 8f2726eb Deployed Nov 16, 2026 by vercel[bot]
Preview – flags-sdk-sveltekit-snippets — 8f2726eb Deployed Nov 16, 2026 by vercel[bot]
Preview – flags-sdk-snippets — 8f2726eb Deployed Nov 16, 2026 by vercel[bot]
Preview – flags-playground — 8f2726eb Deployed Nov 16, 2026 by vercel[bot]
Preview – shirt-shop — 8f2726eb Deployed Nov 16, 2026 by vercel[bot]
Preview – flags-sdk-statsig — 8f2726eb Deployed Nov 16, 2026 by vercel[bot]
Preview – flags-sdk-reflag — 8f2726eb Deployed Nov 16, 2026 by vercel[bot]
Preview – flags-sdk-openfeature — 8f2726eb Deployed Nov 16, 2026 by vercel[bot]
Preview – flags-sdk-flagsmith — 8f2726eb Deployed Nov 16, 2026 by vercel[bot]
Preview – flags-sdk-growthbook — 8f2726eb Deployed Nov 16, 2026 by vercel[bot]
Preview – flags-sdk-vercel — 8f2726eb Deployed Nov 16, 2026 by vercel[bot]
Preview – flags-sdk-posthog — 8f2726eb Deployed Nov 16, 2026 by vercel[bot]
Preview – flags-sdk-launchdarkly — 8f2726eb Deployed Nov 16, 2026 by vercel[bot]
Preview – shirt-shop-api — 8f2726eb Deployed Nov 16, 2026 by vercel[bot]
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.

2 participants