> For the complete documentation index, see [llms.txt](https://docs.amply.tools/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.amply.tools/mini-apps/publishing-and-versions.md).

# Publishing and versions

Publish a mini-app, show it in a campaign, and move a campaign between versions.

A mini-app reaches users in two steps: you **publish** it, which creates a numbered version that doesn't change, and a **campaign** shows that version. Editing never changes what users see until you publish again and point the campaign at the new version.

## Publish

Click **Publish** in the editor's header once the draft shows **Saved**. Amply checks the mini-app first. If something would not work on a device, the **Before you publish** panel lists it:

* **Won't work** — the item can't work on a phone, for example two inputs on one screen saving to the same property key. Fix these first; publishing is blocked while they remain.
* **Warning** — the mini-app works, but something is probably not what you meant, for example a button that goes to a screen that no longer exists, or actions placed after **Navigate** that never run. **Publish anyway** publishes it.

Click an item to jump to it. Once published, the button reads **Published v1**, **v2** and so on. If the draft is identical to a version you already published, publishing returns that version instead of creating a new one.

## Show it in a campaign

Create a campaign and pick the **Mini-app** type on its first step. See [Creating a campaign](https://docs.amply.tools/user-guide/creating-a-campaign.md) for the rest of the form.

![The campaign types: Rate & Review, Deep Link, Blocking (soon) and Mini-app](https://1054862905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNVDwzd9ZLJgvvnIADl8D%2Fuploads%2Fgit-blob-037bb6b4e8584dc209b5a9c8fcf4afaa572268f8%2Fcampaign-type-mini-app.png?alt=media)

In the **What** step, pick the **Document** and its **Published version**. The newest version is selected by default. **Preview** opens that version read-only in a new tab, with a banner that names the version and a **Back to draft** link.

![The What step of a Mini-app campaign: the document and its published version v1](https://1054862905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNVDwzd9ZLJgvvnIADl8D%2Fuploads%2Fgit-blob-b3af9dd8082c0ceb290d07114f912b3941cec857%2Fcampaign-what-mini-app.png?alt=media)

Only a published version can be picked. A mini-app with no published version shows a link to publish it in the Builder.

If some of your users are on an SDK older than 0.12.0, the form tells you what share of devices won't get the campaign.

## Check it on a phone

**Test on device** on the campaign's page shows the version the campaign uses, inside your real app, before anyone else sees it. Scan the QR code with a phone that has your app installed. See [Testing and rollout](https://docs.amply.tools/user-guide/testing-and-rollout.md).

## Change a live mini-app

A campaign keeps showing the version it was given, so you can edit freely:

1. Edit the mini-app. Users still see the published version.
2. **Publish** again to create the next version.
3. Point the campaign at it: change **Published version** in the campaign's What step, or use **Roll back** in the history (below), which works in both directions.

## Publish history

**History** in the editor's header lists every version: when it was published, what changed since the one before (for example *2 strings changed*), its size, and which campaigns show it now. The banner on top says whether your draft has changes that aren't published yet.

![Publish history: v2 is the latest, v1 is the one the campaign still shows](https://1054862905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNVDwzd9ZLJgvvnIADl8D%2Fuploads%2Fgit-blob-b7690d3ad4f2e67583126b1ff42ab600649cb0fe%2Fbuilder-publish-history.png?alt=media)

Each row has two actions:

* **Roll back** points the campaigns you pick at that version. Despite its name it works in both directions: undo a bad version in one step, or move campaigns forward to a newer one. Each device switches the next time the app loads its campaigns from Amply.
* **Restore to draft** copies that version back into your draft to continue editing from it. It changes no campaign.

<figure><img src="https://1054862905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNVDwzd9ZLJgvvnIADl8D%2Fuploads%2Fgit-blob-5e53bf0afe1ad2183ffa5ac9550c115285cddb77%2Fbuilder-roll-back.png?alt=media" alt="The Roll back to v2 dialog: the campaign that will switch, and a note that the draft is not touched" width="520"><figcaption></figcaption></figure>

## Related

* [Building a mini-app](https://docs.amply.tools/mini-apps/building-a-mini-app.md)
* [Campaigns](https://docs.amply.tools/user-guide/campaigns.md#mini-app) — the Mini-app campaign type
* [Built-in campaigns](https://docs.amply.tools/developer-guide/built-in-campaigns.md) — ship a mini-app campaign inside your app build so it shows on the first launch
* [Campaign goals](https://docs.amply.tools/user-guide/campaign-goals.md) — measure what the mini-app leads to
