# Sharing & Preview

Canonical: https://useformwork.com/docs/forms/sharing-preview

Use direct links, draft previews, and production embed code safely.

The builder's **Share** page provides a direct URL and website embed code for the version you are viewing.

## Choose the right output

| Version | Direct link | Embed | Use |
|---------|-------------|-------|-----|
| Published | Loads the latest published version | Loads the latest published version | Production data collection |
| Draft | Includes the draft `preview_version_id` | Includes `preview-version-id` | Staging and testing only |
| Archived | Unavailable | Unavailable | Historic reference only |

## Direct Share Link

Use the standalone link when sending a form by email or message, linking from a button, or when the destination does not allow custom HTML.

A published link has the form ID but no version ID. Publishing later updates it automatically:

```text
https://app.useformwork.com/client/forms/FORM_ID
```

A draft preview is locked to one version:

```text
https://app.useformwork.com/client/forms/FORM_ID?preview_version_id=VERSION_ID
```

## Website Embed Code

The production snippet is:

```html
<formwork-form form-id="FORM_ID"></formwork-form>
<script src="https://app.useformwork.com/static/client.js" type="module"></script>
```

The draft snippet adds `preview-version-id="VERSION_ID"` to the element. Paste the snippet where the form should appear. The script can define multiple `<formwork-form>` elements on a page.

Saved appearance is loaded automatically; no theme stylesheet is required.

## Test without leaking a draft

- Put draft embeds on access-controlled staging pages where possible.
- Do not publish or index draft preview URLs as production links.
- Remember that a test submission creates an entry; there is no special preview-entry status.
- Replace the draft snippet with the published snippet before launch.

## After publishing

You do not need to copy a new published link or embed after each publish. Both resolve the current published version. An entry that already began remains pinned to its original version.

For attributes, events, resume behaviour, and host controls, continue to the [Web Component & JavaScript API](/docs/embedding/web-component). For styling, see [Appearance](/docs/forms/appearance).