Skip to main content

Overview

Ask the agent to run your app’s dev server and you can view the running app from the session, with no deploy needed. Use it to check UI changes before opening a PR.

Start a preview

Prompt the agent, for example:
The agent starts the server in the background and registers its port with Blocks. You can run more than one server, such as a frontend and an API, and each is registered under its own name.

View the preview

Once a server is registered, either:
  • Click the server icon in the session header and pick the server, or
  • Open Session properties and click View next to the server under Local Servers
The app opens in a full-screen view. Press Esc to close it.
Preview URLs can be discovered, so make sure each server or page you preview enforces its own authentication.
A preview is only available for the duration of the Blocks session. When the session ends, the preview goes offline.

Configure your app

Add the variables your app needs (API URLs, keys, and so on) under Settings → Environment Variables. See Environment Variables. They’re available to the dev server at runtime. Your framework’s rules for client-side variables still apply, for example the NEXT_PUBLIC_ and VITE_ prefixes.

Tips

  • Ask the agent to bind the server to 0.0.0.0 if the preview doesn’t load
  • Vite’s allowed-hosts check is preconfigured for previews