Commit Graph

338 Commits

Author SHA1 Message Date
github-actions[bot] c7a56d6a66 Version Packages (#461)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@flags-sdk/hypertune@0.3.3 @flags-sdk/statsig@0.3.0 flags@4.3.0 @flags-sdk/growthbook@0.3.0 @flags-sdk/launchdarkly@1.1.0 @flags-sdk/posthog@1.0.1 @flags-sdk/reflag@1.0.2 @flags-sdk/global-config@0.3.0
2026-08-04 19:12:09 +02:00
Andy 0258b6ca3c Update exports and changesets (#462) 2026-08-04 13:14:03 +02:00
Luis Meyer 58e1f5bcdf Rename Edge Config packages to Global Config (#452)
* Rename edge config packages

* Rename Global Config APIs

* Fix Global Config environment setup

* Rename Global Config endpoints

* Update Global Config documentation links

* Undo lockfile changes

* Update lockfile

* Undo lockfile changes

* Update lockfile

* Fall back to EDGE_CONFIG

---------

Co-authored-by: Andy Bitz <artzbitz@gmail.com>
2026-08-04 12:36:41 +02:00
Dominik Ferber 3a5ba70f53 docs: add no-store to flags discovery endpoint (#459) 2026-08-03 16:14:28 +03:00
christopherkindl 6ddb6b75aa [docs] upgrade geistdocs to 1.19 and rework the homepage layout (#457) 2026-07-31 16:25:46 +02:00
github-actions[bot] 81707e7a0e Version Packages (#456)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@flags-sdk/posthog@1.0.0
2026-07-29 15:01:19 +00:00
Dominik Ferber aec3c03430 @flags-sdk/posthog: upgrade posthog-node; explicit evaluation modes (#436)
* @flags-sdk/posthog: upgrade posthog-node

* @flags-sdk/posthog: make local vs remote evaluation explicit

The default adapter passed POSTHOG_PERSONAL_API_KEY into the runtime
posthog-node client, which enabled local evaluation and started a
feature-flag poller in every warm process. On serverless this produced
large, traffic-independent PostHog feature flag request volume.

Local evaluation is now opt-in via POSTHOG_SECRET_KEY; without it the
adapter evaluates remotely. POSTHOG_PERSONAL_API_KEY is used only by
getProviderData (Flags Explorer) and no longer affects runtime
evaluation. Drops the forced 10s poll interval in favor of the v5
default. Updates docs, README, and tests.

* remove unused @vercel/edge-config dependency

* add remote vs local tradeoffs

* rm edge config tag

* modernize

* rm trimKey

* lockfile

* update

* fixes

* reword changeset

* merge changesets

* reword changelog
2026-07-29 14:54:40 +00:00
github-actions[bot] e718915540 Version Packages (#455)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
flags@4.2.4
2026-07-29 09:49:11 -04:00
Dominik Ferber dcb74ff938 return no-store on flags discovery endpoint (#454) 2026-07-29 09:42:01 -04:00
github-actions[bot] 5ff8eafec9 Version Packages (#451)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@flags-sdk/vercel@1.4.6 @vercel/flags-core@1.7.1
2026-07-27 10:32:21 -04:00
Dominik Ferber ceb15198f7 [@vercel/flags-core] strip g and y regex flags (#450) 2026-07-27 13:50:24 +00:00
Dominik Ferber fde6ab7135 address CodeQL alerts (#448)
* explicit workflow permissions

* max-delay

* better parsing
2026-07-26 10:20:17 -04:00
Dominik Ferber 6dbf589e0c upgrade toolbar and others (#447) 2026-07-26 13:42:26 +00:00
Dominik Ferber 42cc02cacd upgrade more packages (#446) 2026-07-26 13:20:24 +00:00
Dominik Ferber 1f000784e5 upgrade vite & vitest (#445) 2026-07-26 08:25:37 -04:00
Dominik Ferber 0cf1f2b201 upgrade next and postcss (#444)
* upgrade postcss

* [snippets] upgrade postcss

* upgrade next

* upgrade postcss

* upgrade pnpm-lock
2026-07-26 07:35:48 -04:00
github-actions[bot] bd33058932 Version Packages (#443)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
flags@4.2.3
2026-07-24 18:06:50 +03:00
Dominik Ferber 622d56e608 fix(flags): remove @sveltejs/kit from peer dependencies (#442)
@sveltejs/kit was declared as an optional peer with a "*" range, causing
npm to auto-install the newest @sveltejs/kit and pull in its transitive
@sveltejs/vite-plugin-svelte → vite peer chain. In non-SvelteKit projects
already on Vite 7 (via Vitest, Storybook, etc.) this produced a hard
ERESOLVE error requiring `npm install --force`.

Move @sveltejs/kit to devDependencies so the sveltekit entrypoint still
builds and type-generates in the monorepo. SvelteKit consumers always have
@sveltejs/kit installed as the framework, so flags/sveltekit continues to
resolve it from their own tree.

fixes #440
2026-07-24 17:39:25 +03:00
github-actions[bot] 3ba3c40940 Version Packages (#441)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
flags@4.2.2
2026-07-24 15:25:01 +03:00
Sebastian "Sebbie" Silbermann d23d9d2b7a Stop tracing Next.js control-flow errors as span errors (#438)
* Stop tracing Next.js control-flow errors as span errors

The `trace()` helper marked spans as errored via `span.setStatus({ code: 2, message })` for every rejection of the traced function. This included errors that Next.js uses for control flow and that the evaluation layer deliberately re-throws via `isInternalNextError`: redirects, notFound, and the rejected hanging promises of aborted prerenders (`HANGING_PROMISE_REJECTION`).

The hanging-promise case is the noisy one in practice. Whenever a runtime prefetch prerender is aborted while a flag evaluation awaits `connection()` or `cookies()` (for example through an `identify` function that reads the request), the evaluation promise rejects with the `HANGING_PROMISE_REJECTION` digest, and every affected flag span reported "During prerendering, `connection()` rejects when the prerender is complete" as its status description. On heavily prefetched routes this produces a large volume of error-annotated spans for behavior that is entirely expected.

The tracing helper now skips the error status for internal Next.js errors in both the promise rejection path and the synchronous throw path, while still ending the span and preserving span-context attributes. Control flow is unchanged: the error keeps propagating to the caller. `isInternalNextError` moves from `src/next/` to `src/lib/` so the shared tracing module can use it without depending on the Next.js entrypoint; it is a plain digest check with no Next.js imports.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* keep tracing framework agnostic (#439)

* Report ignored control-flow errors as successful spans

When `isIgnoredError` classifies an error as control flow, the traced function completed as intended, so the span now gets an explicit Ok status instead of ending with an unset status. This keeps ignored control-flow rejections (like Next.js hanging promise rejections of aborted prerenders) clearly distinguishable from both errored spans and spans that were never finalized.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Dominik Ferber <dominik.ferber@gmail.com>
2026-07-24 15:22:38 +03:00
Rich Haines f04785a0a1 Update Geistdocs to 1.14.2 (#437) 2026-07-21 13:38:34 +03:00
github-actions[bot] d7fc7e5608 Version Packages (#435)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
flags@4.2.1
2026-07-20 14:40:44 +03:00
Dominik Ferber 4d6eb10705 [flags] allow passing request when invoking flag (#434)
* accept NextRequest in flag(req)

* add changeset
2026-07-20 14:34:03 +03:00
github-actions[bot] 6de1dcdcdc Version Packages (#431)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@flags-sdk/launchdarkly@1.0.0
2026-07-10 15:13:09 +00:00
Marc Brakken 54888657e8 [adapter-launchdarkly] support native Marketplace integration (#418)
* [adapter-launchdarkly] support native Marketplace integration

- Read the Edge Config connection string from EXPERIMENTATION_CONFIG,
  falling back to EDGE_CONFIG for the legacy Vercel integration
- Make LAUNCHDARKLY_PROJECT_SLUG / projectSlug optional; it is only used
  to deep-link flags to the LaunchDarkly dashboard

* [adapter-launchdarkly] read EXPERIMENTATION_CONFIG only

Align with the Statsig adapter: the default adapter reads the Edge Config
connection string from EXPERIMENTATION_CONFIG only and no longer falls back
to EDGE_CONFIG. Legacy Vercel integration users can set EXPERIMENTATION_CONFIG
to their EDGE_CONFIG value or pass edgeConfigConnectionString explicitly.

* [adapter-launchdarkly] mark changeset as major (breaking change)

* Update changelog to have a single recommendation for legacy EDGE_CONFIG env var

* Bring back LAUNCHDARKLY_PROJECT_SLUG as required
2026-07-10 15:03:25 +00:00
github-actions[bot] 0a90e18513 Version Packages (#428)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@flags-sdk/vercel@1.4.5 @vercel/flags-core@1.7.0
2026-07-10 12:48:49 +03:00
christopherkindl 84d4292684 fix(docs): prevent hero-text select label flicker on reload (#430)
Radix Select injects the selected option label into the trigger via a
client-only portal, so the statically rendered page ships an empty
trigger and the label pops in after hydration. Render the value as
SelectValue children instead, so the label is present in the SSR HTML
(this also disables the portal path via valueNodeHasChildren).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 07:03:26 +03:00
Dominik Ferber 50b1aa4f96 Align rollouts assignments with split assignments (#427)
* [@vercel/flags-core] align rollotus and splits

* avoid extra array

* 100k

* full range

* fix comments

* rename

* shorten comments

* add changeset

* add stderr test
2026-07-09 22:48:48 +03:00
Dominik Ferber a6e4e5bd3f Announce Vercel Flags (#426)
* add Vercel Flags banner

* change Learn more links

* format

* fix

* change title
2026-07-09 12:01:04 +00:00
github-actions[bot] 2497853529 Version Packages (#424)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@vercel/flags-core@1.6.0 @flags-sdk/vercel@1.4.4
2026-07-08 14:26:19 +02:00
Luis Meyer 9dff590bd5 Add FLAGS_EVALUATION metric (#401)
* Add FLAGS_EVALUATION metric

* Track variant IDs in evaluation results

* report null instead of fallback

* bucket to the previous minute

* replace variant null with undefined

* invert

* use option instead of env var

* Add track option to black-box flag tests

* Add evaluation metrics controls and flush reasons

* increase max_count

* defaul track:true

* increase batch

* Bound ingest POSTs to 2000 events per request

Flushes can overshoot the scheduler's MAX_COUNT because the map read
happens in a microtask, so a single POST could exceed the server-side
maxItems cap and be rejected with a 400. Chunk sendIngestEvents so each
POST carries at most MAX_EVENTS_PER_REQUEST events.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Remove count-based flushing from the scheduler

Flushing is now purely time-based (idle window, max window, shutdown).
Batches are only cut down to size when the ingest events are sent, via
the 2000-event chunking in sendIngestEvents, which keeps every POST
below the server-side maxItems cap.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* cleanup

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 14:09:45 +02:00
github-actions[bot] 3f87c7844e Version Packages (#422)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@vercel/prepare-flags-definitions@0.4.0
2026-07-03 11:25:58 +02:00
Luis Meyer d601dba20a Add prepare script changeset (#421) 2026-07-03 11:01:43 +02:00
Luis Meyer 2318d788b0 Add retries to prepare script (#420) 2026-07-03 10:49:03 +02:00
Vincent Derks f9c2bb36c8 flags-sdk: use scoped skill identifier for vercel-cli install (#419)
Replace the raw `npx skills add https://github.com/vercel/vercel --skill
vercel-cli` command with the scoped `vercel/vercel@vercel-cli` identifier
and reframe it as a user-facing suggestion rather than an agent
auto-install. Addresses Snyk audit W012 (unverifiable external
dependency / runtime URL that controls the agent).
@flags-sdk/edge-config@0.2.0
2026-07-02 10:51:43 +00:00
github-actions[bot] 66c4809b29 Version Packages (#417)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-27 06:52:37 +00:00
Dominik Ferber f60c99d707 [vercel-flags-core] fix datafile serialization (#416) 2026-06-26 17:40:11 +03:00
Dominik Ferber 4b7d8c4382 Improve writing on docs (#415)
* add bulk evaluation to docs

* clarify dynamism

* rewrite

* update skill

* polish docs
2026-06-26 12:16:56 +00:00
Dominik Ferber a9ad243fe1 [flags-sdk.dev] document bulk evaluation (#405)
* add bulk evaluation to docs

* clarify dynamism

* rewrite

* update skill
2026-06-26 08:41:31 +00:00
Dominik Ferber 3971df16b3 docs: note flags 4.2.0 requirement and package rename for adapter shorthand (#410)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 14:52:31 +02:00
Dominik Ferber c0d8224015 docs: use adapter factory shorthand (adapter: vercelAdapter) (#409)
Update docs and examples to pass the adapter factory directly
(adapter: vercelAdapter) instead of calling it (adapter: vercelAdapter()),
reflecting the AdapterOrFactory support in flag(). Applied consistently to
all zero-arg factory adapters (vercel, edge-config, custom adapter examples).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 12:22:47 +02:00
christopherkindl edbc76408d docs: update to geistdocs 1.8.0 and drop Flags from OSS dropdown (#407)
* docs: update to geistdocs 1.8.0 and drop Flags from OSS dropdown

Bump @vercel/geistdocs to 1.8.0 (eve logo, Streamdown dropped, AI Elements
last) and override navbarOssProducts to exclude Flags SDK on its own site.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs: link eve to /docs in OSS dropdown

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 14:29:20 -07:00
Luis Meyer c35f38dfb9 Support createClient options-first overload (#406) 2026-06-23 14:32:06 +02:00
Rich Haines d8ed11ef08 Migrate docs app to @vercel/geistdocs (#391)
* Migrate docs app to Geistdocs canary

* Fix docs proxy matcher

* Use Geistdocs UI exports

* Update Geistdocs to 1.3.0

* upgrade geistdocs and fix svelte logo

* add copy prompt to certain docs pages

* migrate to 1.5.0

* refactor(docs): use geistdocs v1.5 Badge, CommandPrompt, ThemeAwareImage

Remove the local copies now exported by @vercel/geistdocs@1.5 and import
them from the package instead:

- Badge -> @vercel/geistdocs/components/badge (provider-list)
- CommandPrompt -> @vercel/geistdocs/components/command-prompt (install-command)
- ThemeAwareImage -> @vercel/geistdocs/components/theme-aware-image
  (docs MDX components); migrate the SvelteKit MDX call site to the new
  src={{ light, dark }} API.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(docs): restore install switcher width animation

The hero "For humans / For agents" switcher called router.refresh() on
every toggle (added in #366). That remounts/reconciles the switcher
subtree mid-toggle, resetting the CommandPrompt's measured width state so
the command-line width spring never plays — the line snapped instead of
growing.

Drop the refresh: this flag's only consumer is the switcher itself, so the
optimistic override already shows the correct command and the cookie
persists the choice across reloads (the server reads it and renders the
matching prebuilt `[code]`). The refresh changed nothing visible and only
broke the animation. startTransition() does not help, since router.refresh
already runs as a transition.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(docs): render home code blocks with geistdocs CodeBlock

Replace the hand-rolled shiki token renderer in HighlightedCode with
fumadocs highlight() + the geistdocs CodeBlock, highlighting with the
shared geistShikiTheme so the home page "Effortless setup" blocks match
the documentation (same syntax colors, header, language icon, copy
button, radius). transformerIcon() fills the filename icon slot; the
caption is preserved below.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(docs): equal-height home code blocks

Grow each HighlightedCode block to fill its grid cell (h-full root +
flex-1 wrapper forcing the Card to h-full) so both columns share the
taller block's height and their captions align. The Card and its <pre>
share bg-background-100, so the shorter block fills seamlessly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(docs): drop dead shadcn tokens (chart-*, sidebar-primary)

Only chart-1..5 and sidebar-primary are unused by both the app and the
geistdocs/fumadocs package CSS. The other shadcn tokens (secondary,
card-foreground, the remaining sidebar-* set, etc.) must stay: the package
stylesheet consumes them via var(--token) for its fd-* utility mappings
and the #nd-sidebar rule, and does not self-define them — the consuming
app has to provide them.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(docs): migrate consumers off shadcn tokens to Geist scale

Switch every shadcn-token consumer (select, switch, iframe-browser, the
home marketing pages, and the illustrations SVGs) to the Geist --ds-*
scale using the geistdocs PR #75 mapping (foreground->gray-1000,
muted->gray-100, muted-foreground->gray-800, border/input->gray-alpha-400,
ring->gray-600, destructive->red-800, background/card/popover->
background-100, accent->gray-100, etc.).

With no consumers left, drop the entire local shadcn layer from
geistdocs.css (the @theme --color-* mappings and the :root/.dark oklch
palette) and instead override fumadocs --color-fd-* and #nd-sidebar to
--ds-* (so the package's docs UI keeps working without the raw palette),
matching the geistdocs template. The geist utilities themselves come from
@vercel/geistdocs/styles.css.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Update geistdocs.css

* migrate to 1.6.0

* chore(docs): bump @vercel/geistdocs to 1.6.1

Picks up the Next.js logo gradient-id fix so the framework logo renders
correctly in the mobile docs menu.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Update pnpm-lock.yaml

* fix(docs): drop language icons from landing-page code blocks

The home "Effortless setup" snippets are Next.js examples, but the
language-based transformerIcon rendered a React glyph for the .tsx block.
Remove the icons (these blocks never had them) and hide the now-empty
header icon slot so the filename stays flush.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(docs): drop redundant streamdown @source

The streamdown @source pointed at a transitive dep path that doesn't
resolve under pnpm (matched nothing). Streamdown is now sourced upstream
from @vercel/geistdocs's own styles.css, so this line is unneeded.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* update

* bump @vercel/geistdocs

* Update pnpm-lock.yaml

* update

---------

Co-authored-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 18:37:35 +02:00
github-actions[bot] 0b40d46d26 Version Packages (#404)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-17 16:22:35 +03:00
Dominik Ferber 4705ac67cb [@flags-sdk/edge-config] support bulk and simple interface (#403)
* [@flags-sdk/edge-config] support bulk and simple interface

* reword
2026-06-17 13:17:48 +00:00
Dominik Ferber 2cb0b49698 Allow passing an adapter factory directly to flag() (#402)
* Allow passing an adapter factory directly to flag()

flag() now accepts the adapter factory by reference (`adapter: vercelAdapter`)
as a shorthand for calling it (`adapter: vercelAdapter()`). The factory is
resolved once per declaration; passing an instance keeps working. Applies to
both the Next.js and SvelteKit entrypoints.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* [@flags-sdk/vercel] reuse adapter instance

* reword changeset

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 16:14:25 +03:00
github-actions[bot] 158634cc5d Version Packages (#400)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
flags@4.1.1 @flags-sdk/vercel@1.4.1 @vercel/flags-core@1.5.1
2026-06-16 17:52:22 +03:00
Luc Leray b0150af9c8 [@vercel/flags-core] quiet noisy stream reconnect logs (#395)
* [@vercel/flags-core] quiet noisy stream reconnect logs

* [@vercel/flags-core] test exhaustion log + guard undefined reason
2026-06-16 14:43:25 +00:00
Dominik Ferber 50725a8dcf add changeset (#399) 2026-06-16 14:33:00 +00:00