Skip to content

examples: app-builder preview, a phone per end user embedded in your page - #68

Merged
Musti7even merged 1 commit into
mainfrom
app-builder-preview
Nov 25, 2026
Merged

Musti7even merged 1 commit into
mainfrom
app-builder-preview

Conversation

@Musti7even

@Musti7even Musti7even commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

A reference integration for app builders. Two files, no dependencies, Node 20+:

  1. The API key stays server-side; the browser only gets a short-lived embed URL.
  2. One phone per end user, created with end_user and display_hz: 30, reused and started again when parked.
  3. An APK URL installs and opens; an Expo link (exp://, exps://, https://expo.dev/…) opens in the Expo Go that matches the project's SDK.
  4. The live phone is embedded through /embed, locked to the page's origin, interactive.
  5. Signed webhooks are verified (Mobilebox-Signature, 5 min window) and shown as phone state.
  6. Usage per end user comes from /v1/account/usage?by=end_user.

On start it adds the page origin to the embed origins (keeping existing ones) and points the workspace webhook here, unless the webhook already points elsewhere (MOBILEBOX_TAKE_WEBHOOK=1 overrides).

Run against production on 2026-11-25 through a Cloudflare quick tunnel, driven in Chrome (RUNS.md, demo.gif):

  • An APK preview, new phone: 29 s. A parked phone back: 15 s.
  • An Expo SDK 58 app for a second end user: 30 s, with Fast Refresh in the embed.
  • Park produced signed phone.parked webhooks, and usage per user updated.

The page polls instead of using server-sent events, because Cloudflare quick tunnels hold an SSE stream back (measured: nothing arrived in 22 s).

UI: impeccable critique (dual-agent; detector clean, design review 31/40). Fixed before this PR:

  • usage errors shown instead of "no minutes"
  • the phone fits the window and comes first on narrow screens
  • Park acts on the phone on screen
  • proxy error pages read plainly
  • error colour and input-border contrast in dark mode
  • hints tied to their fields

npm run lint runs server.mjs --self-check (signature tests).

🤖 Generated with Claude Code

…page

A copyable reference integration for products that show their users a live phone preview (two files, Node 20+, no
dependencies): API key server-side; one phone per end user (end_user, display_hz: 30), reused and restarted; an APK URL
installs, an Expo link opens in the matching Expo Go; the live phone embedded through /embed locked to the page's
origin; signed webhooks verified and shown; usage per end user. Run end to end against production on 2026-11-25
(RUNS.md, demo.gif). Lint runs its signature self-check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Musti7even
Musti7even merged commit cf295d9 into main Nov 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant