Skip to content

@vercel/flags-core: add flag/variant IDs for evaluation tracking#336

Draft
dferber90 wants to merge 1 commit intomainfrom
packed-ids
Draft

@vercel/flags-core: add flag/variant IDs for evaluation tracking#336
dferber90 wants to merge 1 commit intomainfrom
packed-ids

Conversation

@dferber90
Copy link
Collaborator

Summary

  • Add id and variantIds fields to Packed.FlagDefinition so evaluations can reference flags and variants by stable IDs
  • Evaluate now resolves variantId directly and includes it on EvaluationResult
  • New FLAG_EVALUATION event type sent to /v1/ingest via UsageTracker.trackEvaluation() for dashboard display
  • OpenFeature provider now returns variant on ResolutionDetails per the spec

Test plan

  • All 400 existing tests pass
  • TypeScript compiles cleanly
  • Backwards compatible: variantId is undefined when variantIds not present in definition
  • Verify FLAG_EVALUATION events appear in /v1/ingest with correct flagId/variantId/reason

🤖 Generated with Claude Code

… and evaluation tracking

Add `id` and `variantIds` fields to `Packed.FlagDefinition` so evaluations
can be reported with stable IDs. The evaluate function now resolves `variantId`
directly and includes it on `EvaluationResult`. A new `FLAG_EVALUATION` event
type is sent to `/v1/ingest` via `UsageTracker.trackEvaluation()`, and the
OpenFeature provider now returns `variant` on `ResolutionDetails`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Contributor

vercel bot commented Mar 14, 2026

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

Project Deployment Actions Updated (UTC)
shirt-shop Ready Ready Preview, Comment Mar 14, 2026 2:15pm
shirt-shop-api Ready Ready Preview, Comment Mar 14, 2026 2:15pm

@dferber90 dferber90 marked this pull request as draft March 14, 2026 14:22
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.

1 participant