> For the complete documentation index, see [llms.txt](https://lingojs.gitbook.io/lingojs-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lingojs.gitbook.io/lingojs-docs/auto-publish.md).

# Auto-Publish

Auto-publish makes detected translations available without manual review. Enable it only after the standard Pending workflow works correctly.

{% hint style="warning" %}
Domain restriction is mandatory for both auto-publish modes. Enabling either mode enables Domain restriction automatically. It cannot be disabled while at least one auto-publish option remains active; disable both modes first.
{% endhint %}

## Global Auto-Publish

Enable global auto-publish from **Dashboard > Project > Project Settings > Auto-publish Translations**.

When enabled:

* newly detected translations can be published automatically;
* an existing Pending translation is promoted to Published if the snippet detects it again under an authorized auto-publish flow;
* domain restriction is enabled automatically;
* production browsers must obtain a valid Turnstile-backed snippet session.

The public project key alone cannot authorize auto-publishing.

## Per-element Auto-Publish

Per-element auto-publish is disabled by default. In **Dashboard > Project > Project Settings**, enable **Allow auto-publish for selected elements** before using it.

When global auto-publish is disabled, mark selected content with `lingojs-autopublish="yes"`:

```html
<div lingojs-autopublish="yes">
  Free shipping on orders over $50!
</div>

<p>This text follows the normal Pending workflow.</p>
```

The attribute works on content elements inside `<body>` and applies to their detected descendants. It is honored only when the project option is enabled. Otherwise, marked text follows the normal Pending workflow. Enabling the option also enables domain restriction, and browser verification remains mandatory.

When both modes are enabled, global auto-publish already applies to all detected content, so the per-element attribute does not make the workflow more permissive. Blocked translations remain Blocked and are not promoted automatically.

## Browser verification

On a configured production domain, the snippet obtains a short-lived session after Cloudflare Turnstile verification.

The session is reused for 10 minutes in the same browser tab, including across page loads. Turnstile therefore does not run once per detected text or request batch.

Turnstile remains invisible unless Cloudflare requires visitor interaction. In that case, the challenge appears in the bottom-right corner.

## Strict Content Security Policy

If the website uses a strict Content Security Policy, allow `https://challenges.cloudflare.com` in both `script-src` and `frame-src`. Also ensure that the policy allows the snippet host, API connections to `https://api.lingojs.com`, the initialization script, and widget styles when the widget is enabled. See **Allowed Domains & Security** for the complete checklist.

## Local testing

Local origins do not use Turnstile. They require Development Mode and a valid named development token.

Never deploy the development token to production.
