Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
12 KiB
@vercel/flags-core
1.8.1
Patch Changes
-
#486
c9d2811Thanks @dferber90! - Add APIs for reporting flag exposures and override values.- The
experimental_reportExposuresclient option for supplying an exposure reporter. - The
experimental_reportOverrideclient method for reporting values set by the Flags SDK override cookie. - The
experimental_exposureLoggingoption onevaluate()andbulkEvaluate()for disabling exposure reporting for an individual call. - Experiment assignment metadata on
EvaluationResult.experiment. - The
experimental_EvaluationOptions,experimental_ExperimentAssignment,experimental_Exposure, andexperimental_ReportExposurestypes.
These APIs are not supported for general use yet. Do not use them unless Vercel has explicitly enabled them for you.
- The
-
#494
e0eebe6Thanks @luismeyer! - Request an uncompressed/v1/streambody when running on Bun.Bun's
fetchnegotiates brotli or gzip by default, but its streaming decoder withholds small decoded output until more compressed input arrives. The stream's first datafile is followed by silence until the next ping, so on Bun the initial datafile never surfaced, init timed out, and every flag fell back to its default. SendingAccept-Encoding: identityon Bun avoids the decoder entirely; other runtimes are unchanged.
1.8.0
Minor Changes
- #453
cc8c266Thanks @luismeyer! - Add ametricEnvironmentclient option for associating evaluation metrics with an environment when sending them to the ingestion endpoint.
1.7.1
Patch Changes
- #450
ceb1519Thanks @dferber90! - Strip thegandyflags from RegEx conditions to prevent cachedRegExpinstances from retaininglastIndexstate.
1.7.0
Minor Changes
-
#427
50b1aa4Thanks @dferber90! - Align rollout, split, and segment split user assignment onto a single hash bucketing scheme.Previously splits and rollouts bucketed users with opposite conventions, so switching a flag between a split and a rollout (or locking in a rollout as a split) could reassign users even when the effective distribution was unchanged. All three now derive their cut points from one shared boundary function over the full hash space, so a rollout at a given percentage is identical to the equivalent split.
Split assignments are effectively unchanged. Rollouts and segment splits are re-bucketed once with this release; after that, converting a flag between outcome types never reassigns anyone.
1.6.0
Minor Changes
- #401
9dff590Thanks @luismeyer! - Add aggregated flag evaluation telemetry and aclientNameoption for the Vercel Flags client.
1.5.2
Patch Changes
-
#416
f60c99dThanks @dferber90! - Fix datafile serialization across the RSC server/client boundary.Evaluation memoized scaled split weights and compiled regexes by attaching symbol-keyed properties directly onto objects inside the datafile. While symbols are invisible to
JSON.stringify, React Server Components serialization walks objects directly and chokes on these (notably the non-serializableRegExp), so datafiles could no longer be passed from server to client components. Memoization now uses module-levelWeakMaps keyed by the outcome/rhs objects, leaving datafile objects pristine while keeping identical caching semantics and lifetime.
1.5.1
Patch Changes
-
#395
b0150afThanks @lucleray! - Reduce log noise from stream reconnects.Retryable stream errors are no longer logged on every failed attempt; the underlying error is now surfaced only once retries are exhausted (via the existing "Max retry count exceeded" log). The stream/polling initialization timeout warnings were also reworded to make clear the client keeps connecting in the background while serving fallback values.
1.5.0
Minor Changes
-
#385
201f9d5Thanks @dferber90! - AddbulkEvaluatemethod toFlagsClientfor resolving multiple flags against shared entities in a single call.const results = await client.bulkEvaluate( [ { key: "a", defaultValue: false }, { key: "b", defaultValue: "off" }, ], entities ); results.a; // EvaluationResult<boolean> results.b; // EvaluationResult<string>Avoids the per-flag overhead of separate
evaluate()calls — the datafile is read once, entities are resolved once, and all flags share the same environment/segments lookup. Each entry in the returned record is a fullEvaluationResultwithvalue,reason,outcomeType, andmetrics. -
#371
bd4d01aThanks @vincent-derks! - Add jitter to ingest retries and the batch-flush window.The usage tracker now uses AWS-style "Full Jitter" exponential backoff between retry attempts (replacing the previous deterministic 100/200ms schedule) and randomizes the 5s batch-flush window by ±20% to desynchronize concurrent processes. When all retry attempts are exhausted the SDK now logs a structured warning so consumers can alert on dropped batches.
-
#390
7b5ea9aThanks @luismeyer! - Add OIDC authentication support for Vercel Flags clients and generated flag definitions.@vercel/flags-corecan now create clients without an SDK key and authenticate with a Vercel OIDC token, while still supporting SDK keys and connection strings. Bundled definitions can be looked up by SDK key hash or OIDC project ID.@vercel/prepare-flags-definitionsnow collects both SDK keys andVERCEL_OIDC_TOKEN, fetches definitions for each auth entry, deduplicates identical definitions across SDK keys and OIDC project IDs, and writes generated maps keyed by SDK key hash or project ID.@flags-sdk/vercelnow supports provider data lookup for Vercel flag origins that do not include an SDK key, allowing OIDC-backed clients to resolve project metadata.
Patch Changes
-
#382
4d90e91Thanks @dferber90! - Speed up flag evaluation on the hot path.handleOutcomeno longer recomputesscaledWeightson every split-outcome evaluation; the per-outcome scaled weights are cached on first call.matchConditionsno longer recompilesRegExpon every REGEX / NOT_REGEX condition; the compiled regex is cached on first call.Controller.read()andgetDatafile()no longer re-destructure and re-spread the in-memory datafile on every call; the result is cached and rebuilt only when stream/poll replaces the underlying data.
In micro-benchmarks the pure
evaluate()path is ~22% faster for split outcomes and ~32% faster for regex conditions. The fullclient.evaluate()path is 14–22% faster across all scenarios.
1.4.0
Minor Changes
80dcdad: Add progressive rollout outcome
1.3.1
Patch Changes
-
b755ffe: Fix SDK key detection to avoid false positives with third-party identifiers.The SDK key validation now uses a regex to require the format
vf_server_*orvf_client_*instead of accepting any string starting withvf_. This prevents false positives with third-party service identifiers that happen to start withvf_(e.g., Stripe identity flow IDs likevf_1PyHgVLpWuMxVFx...).
1.3.0
Minor Changes
4446057: Support JSON flag values in addition to boolean, string, and number
1.2.1
Patch Changes
b81963d: Loosen the type restrictions on theEvaluationtype as the previous implementation would only work withinterfacebut not withtypethat lead to an accidental breaking change.
1.2.0
Minor Changes
-
64619d7: Allow specifying entities type when creating clientsYou can now create clients while specifying the entities type:
type Entities = { user: { id: string; name?: string } }; const client = createClient<Entities>(""); client.evaluate("flagKey", undefined, { user: { id: "" } }); // uses Entities type for contextYou can still narrow the entities type when evaluating flags:
client.evaluate<{ user: { id: string; name: string } }>( "flagKey", false, { user: { id: "", name: "" } } // uses custom entities type );
Patch Changes
4a5f56a: Skip sending config read events for dev and custom backends
1.1.1
Patch Changes
dd1396e: Guard internal flag hooks when Vercel does not expose the expected runtime helpers during evaluation.
1.1.0
Minor Changes
-
823bf78: Add CJS support -
722b0d0: - adds CONTAINS & NOT_CONTAINS comparators- adds case insensitive versions of all string based comparators
-
b70c2ea: This version of the SDK will no longer fall back to polling in case of streaming issues, and rely on the current in-memory version of the datafile instead, or fall back to the embedded datafile if no in-memory version is available.- Rename
FlagNetworkDataSourcetoController(old name still exported as alias) - Rename
FlagNetworkDataSourceOptionstoControllerOptions(old name still exported as alias) - Rename
DataSourceinterface toControllerInterface - Add optional
revisionfield toDatafileInput
- Rename
Patch Changes
a924044: Fix bug with inverted NOT_ONE_OF segment comparator
1.0.1
Patch Changes
7d7719a: Fixed an issue where concurrent flag evaluations (e.g.Promise.all([client.evaluate('a'), client.evaluate('b')])) would each trigger a separate initialization, causing a flood of network requests to the flags service. Also fixed stream disconnect during initialization from starting a duplicate polling cycle.
1.0.0
Major Changes
c71729b: See http://vercel.com/docs/flags/vercel-flags for more information.
Patch Changes
- Updated dependencies [
795dfd4]- flags@4.0.3
0.1.8
Patch Changes
620974c: [internal] change label to note
0.1.7
Patch Changes
43293a3: depend directly on @vercel/edge-config (removed as peer dep)
0.1.6
Patch Changes
0.1.5
Patch Changes
6a7313a: publish cjs bundles besides esm
0.1.4
Patch Changes
df76e2c: export evaluate fn
0.1.3
Patch Changes
9ecc4de: export Packed type
0.1.2
Patch Changes
bfe9080: export DataSource type
0.1.1
Patch Changes
ff052f0: upgrade internal @vercel/edge-config dependency to v1.4.3