Sync v2 SDK with preview bootstrap API#163
Open
rickeyswuave wants to merge 2 commits into
Open
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
rickeyswuave
marked this pull request as ready for review
July 10, 2026 16:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sync the v2 SDK with the secure preview bootstrap API from vercel/v0#26583.
fetchPreviewproxy helper and exports.Problem
The previous SDK modeled previews as a raw URL, token, and expiration. Its
fetchPreviewhelper forwarded requests withx-v0-preview-token, but browser redirects and Next.js asset requests do not preserve that custom header without a full reverse proxy.The v0 API now returns a nullable
{ url }containing a short-lived bootstrap URL, so the header-based SDK helper is no longer valid.Solution
v0.chats.getPreviewis regenerated with the new direct response:Customers can redirect their authenticated iframe route to
preview.url. The v0 preview gateway establishes the browser session, then the preview and its assets load directly from the preview origin.The obsolete proxy helper, preview token header, refresh header, and related exports are removed.
Verification
bun run generatebun run typecheckbun run buildfetchPreview, preview-token, or preview-refresh references remain.