# Draft and publish

> Change your app in a private draft, then choose when visitors get it.


Your app has two versions: a **draft** that only you can see, and a **live** version that visitors get. The AI chat, Edit mode and restoring an earlier version all change the draft. Your visitors keep seeing the live version until you choose **Publish**.

## Publish your changes

1. Try your changes on the **Preview** tab. It always shows the draft.
2. Choose **Publish** in the header. It's next to **Deploy**, and it reads **Published** when visitors already have the latest version.

Publishing doesn't use a message. It uses the build you just tried, so visitors get exactly what you saw. If the new version doesn't start, your live app stays as it was. **Publish** is turned off while a change is running, or if the draft's latest build failed.

Your app's first working version goes live by itself, so it has an address to share right away. After that, you decide.

Apps made before drafts existed work the same way. Their current version stays live, and their next change goes to the draft.

## What the draft shares with your live app

The draft isn't a separate copy of your data. Keep these in mind while you try things out:

- **Your data is real.** Records you add, change or delete in the draft change them for your live app too. [Backups](/docs/building/what-the-ai-can-do#your-apps-data) can bring records back.
- **New tables appear right away,** so the draft can use them. Changes to an existing table's rules, like who can read it, wait until you publish.
- **Secrets and connected accounts are shared.** A function you try in the draft can really send an email or use your connected account.

These only start working when you publish:

- Automations, AI agents and workflows that a change adds or edits. The live versions keep running until then.
- Your tracking and analytics tags. Your own visits to the draft aren't counted either.
- Automatic Vercel deploys.

## Who can see what

- **The draft's address** ends in `--draft` and opens only for you, in a browser where you've opened the project.
- **Your app's address** and custom domain always show the live version.
- **Explore** shows the live version, and people who clone your app get the live version's files.

**GitHub** and **Deploy** send the draft's files, so publish first if you want them to match your live app.

## Branches

[Branches](/docs/building/app-editor-overview) don't have a separate draft. Merging one into main changes main's draft, and you then publish it like any other change.
