Configure and prepare Universal Checkout sample sessions - #842
Draft
tiagocandido wants to merge 1 commit into
Draft
tiagocandido wants to merge 1 commit into
tiagocandido wants to merge 1 commit into
Conversation
tiagocandido
added this pull request to stack #845
September 28, 2026 15:20
tiagocandido
marked this pull request as ready for review
September 28, 2026 15:23
Package Size
Web file breakdown
Measured from the PR base SHA and PR head SHA. The file breakdown shows uncompressed sizes within each package artifact, so individual files do not sum to the compressed artifact total. This comment reports package artifact sizes only; it is not a final app binary-size report. |
tiagocandido
force-pushed
the
uc-sample-session
branch
from
September 28, 2026 15:45
75ddadc to
c963b15
Compare
tiagocandido
marked this pull request as draft
September 29, 2026 10:01
This branch has not been deployed
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.
What changes are you making?
Create independent Storefront carts from the selected products, check for a shared currency and prepare a Universal Checkout session whose continuation URL can be opened by the next sample layer. Invalidate prepared state when shops, quantities, country or environment change, and ignore stale asynchronous responses.
Configure initial domains through the repository-root
.env/.env.local:CHECKOUT_KIT_UC_SHOP_DOMAINSfalls back toSTOREFRONT_DOMAIN, and an explicit empty value starts with no shops. Domains remain editable..env.localoverrides.env, with shell values as fallback. A guarded local runtime route exposes only initial domains and the optional development continuation host; environment values are never compiled into browser assets.Keep session creation endpoints on the local server. Production destinations are restricted to HTTPS on
shop.app; local development requires an explicit endpoint and continuation-host trust pair. The adapter validates loopback/same-origin requests, catalog/cart destinations, response sizes, currency and keyed continuation URLs. Tokens and keyed URLs are not logged or persisted.How to test
From the repository root, with dependencies installed:
pnpm --dir platforms/web lint pnpm --dir platforms/web test pnpm --dir platforms/web build pnpm --dir platforms/web verify pnpm --dir platforms/web sample:buildThe full stack passes 440 Web tests plus lint/typechecks, package verification and sample build. Focused tests cover file precedence, empty configuration, runtime field allowlisting, origin checks, destination validation, partial failures, aborts and stale results. A synthetic build scan verifies that configured domains, continuation hosts and unrelated Vite secrets do not appear in generated browser assets.
Set synthetic or approved shop domains in an ignored root
.env.local, restart Vite and verify automatic shop selection; edit shops through the UI, select products, prepare a session and confirm editing a cart disables the prepared URL.tophat results
On the public-base revision, the browser loaded two shops from ignored environment configuration, loaded both catalogs, created separate carts and prepared a continuation URL. The overlay opened and its close event appeared in the DOM. Removing a shop invalidated the prepared URL; reload restored configured shops with empty carts. This configuration retest did not receive live start/update events in the in-app browser; the earlier live event evidence remains separate.
An earlier integrated browser run loaded two catalogs, selected products independently, created Storefront carts and prepared a continuation URL that opened an authenticated checkout. No payment was submitted. Environment-loading regressions added here are covered by the focused configuration and middleware tests.