Repository navigation
Host the examples on Cloudflare: embed mode, /html, CI route checks - #3
Merged
Merged
Conversation
Adds wrangler.jsonc, open-next.config.ts and preview, deploy and cf-typegen scripts. npm run build is still a plain next build. Next.js moves to 15.5.26, the release line the adapter supports.
With a secret key the route now reads the real names of the configured event keys instead of listing events from the account. An empty optional event key now falls back to the main one.
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.
Prepares the example to run as a hosted demo on Cloudflare Workers and to be embedded in documentation pages.
Changes
wrangler.jsonc(workerseatlayer-examples,nodejs_compat, no account ids or routes),open-next.config.ts(static assets incremental cache, no bucket needed),public/_headers, andpreview,deployandcf-typegenscripts.npm run buildis still a plainnext build, so Vercel andnpm startare unchanged. Next.js moves from 15.1.6 to 15.5.26 because@opennextjs/cloudflare1.20 supports the 15.5 line.?embed=1. Set once inapp/layout.tsx: a small inline script marks<html>before the first paint, and CSS hides the navigation and the route heading. Works on every route./html.app/html/index.htmlis the seat picker as a plain HTML page with the CDN script tag and<YOUR_EVENT_KEY>/<YOUR_PUBLIC_KEY>placeholders.app/html/route.tsfills them fromNEXT_PUBLIC_SEATLAYER_EVENT_KEY/NEXT_PUBLIC_SEATLAYER_PUBLIC_KEYper request, and shows a setup message when they are missing.onCheckoutposts the hold id to/api/hold, like the single event route. Linked from the navigation as "Plain HTML"./api/eventslists only the configured events. The account-wide listing is gone. Without a secret key the route serves the configured keys with placeholder names; withSEATLAYER_SECRET_KEYit reads each configured event's real name with the server SDK. An emptyNEXT_PUBLIC_SEATLAYER_EVENT_KEY_2/_3now falls back to the main key instead of producing an empty key. Wording updated in.env.example, the README, the events page and the checkout handoff page.DEMO_EVENT_KEYandDEMO_PUBLIC_KEYrepository secrets exist (optionalDEMO_SEASON_KEY), it starts the app and runsscripts/check-routes.mjs, which loads every route with and without?embed=1in Chromium and fails on an HTTP error, an uncaught exception, a console error, or a visible navigation in embed mode. Forks without the secrets only build.Verification
npm ci && npm run buildfrom a clean checkout.npx opennextjs-cloudflare buildsucceeds;opennextjs-cloudflare preview(local workerd) returns 200 for every route,/api/events, and/htmlwith the placeholders filled.next devwithout keys:scripts/check-routes.mjspasses on all 16 route and embed combinations (setup notices, no console errors, no hydration warnings, navigation hidden with?embed=1).Nothing was deployed.
Held: merge when the hosted demo is ready.