> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blocks.team/llms.txt
> Use this file to discover all available pages before exploring further.

# Live Preview

> Run your frontend's dev server in the sandbox and preview it from the dashboard

## 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:

```markdown theme={null}
Install dependencies and run the dev server for apps/web so I can preview it
```

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.

<Warning>
  Preview URLs can be discovered, so make sure each server or page you preview enforces its own authentication.
</Warning>

<Note>
  A preview is only available for the duration of the Blocks session. When the session ends, the preview goes offline.
</Note>

## Configure your app

Add the variables your app needs (API URLs, keys, and so on) under **Settings → Environment Variables**. See [Environment Variables](/using-blocks/features/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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.