Live preview & simulation modes
How generated apps run in an isolated browser sandbox, what each preview mode allows, and how simulated activity is kept clearly apart from real chain activity.
Where generated code runs#
Generated code never runs on Blueprint's servers. The server only validates files and bundles them with esbuild from Blueprint's own dependencies — no package installs, no network access, no execution. The result is a single self-contained HTML document.
That document runs in your browser inside an iframe with sandbox="allow-scripts allow-forms allow-modals" and no allow-same-origin. The frame has an opaque origin: it cannot read Blueprint cookies or storage, cannot call Blueprint's APIs as you, and cannot script the workspace around it.
<iframe
sandbox="allow-scripts allow-forms allow-modals"
srcdoc="…bundled app…"
title="Live preview">
</iframe>Preview modes#
| Mode | Wallet | Chain access | Use it for |
|---|---|---|---|
| Design | None | Not used | Layout and styling. |
| Interactive | Disabled | Public RPC reads | Navigation, forms and app logic. |
| Blockchain Simulation | Simulated provider | None — all fake | Walking through wallet and transaction flows safely. |
| Production Preview | Your real address, read-only | Real reads only | Checking real balances and contract reads before publishing. |
Blockchain Simulation Mode#
Simulation injects an EIP-1193 provider that is fake by design and labelled everywhere it appears:
- A fixed simulated address,
0x0000…5157, that no one controls. - Simulated balances: 12.5 of the native asset and 2,500 of any token you query.
- A holder toggle so you can see both the gated and ungated version of token-gated pages.
- Simulated transaction hashes that “confirm” after about 1.6 seconds. Nothing is broadcast and no signature is real.
Every value that comes from the simulated provider is flagged simulated: true by @blueprint/wallet, and Blueprint's UI marks it with a Simulated chip. Simulated sign-ins are never reported as verified.
Preview tools#
- Device frames for desktop, tablet and mobile, plus fullscreen.
- Automatic refresh after each successful build; manual refresh at any time.
- Console output and runtime errors forwarded from the frame, with file and line when the bundle has them.
- Build errors link back to the file in the code panel; one click asks the AI to fix the build.
Previews vs hosted apps#
Previews are private to you and expire. Publishing creates a hosted app under /apps/<slug> with a strict Content-Security-Policy — see Hosting. In both cases only PUBLIC_* environment variables are compiled into the bundle.
