> 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/local-development.md).

# Local Development

Use Development Mode to test a website locally while connecting to the production LingoJS API when Domain restriction is enabled.

## Supported local origins

Development Mode recognizes:

* `localhost`;
* `127.0.0.1`;
* `*.local` hostnames;
* `*.test` hostnames.

Development Mode is available only while Domain restriction is enabled. In that case, local access requires a named token.

If Domain restriction is disabled, requests from every domain—including local origins—follow the normal open Pending workflow. Development Mode and development tokens are not used.

## Create a development token

1. Open **Dashboard > Project > Project Settings**.
2. Find **Development Mode**.
3. Enter a name identifying the developer or environment.
4. Click **Create token**.
5. Copy the raw token immediately. It is shown only once.

Add it only to the local configuration:

```js
window.lingojs.initialize({
  projectKey: 'YOUR_PROJECT_KEY',
  baseLanguage: 'en',
  targetLanguage: 'fr',
  devToken: 'YOUR_DEVELOPMENT_TOKEN'
});
```

{% hint style="danger" %}
Never deploy, publish, share, or commit a development token. Never expose it through production HTML or a public environment variable.
{% endhint %}

## Token lifecycle

* Tokens do not expire automatically.
* LingoJS stores only a hash of the token.
* Create one token per developer or local environment.
* Deleting a token revokes it and its active snippet sessions immediately.

If a token is exposed, delete it and create a new one.

## Rejected local requests

A missing, invalid, deleted token—or disabled Development Mode—causes the complete local detection request to be rejected. No Pending or Published translation is created.

Authorized local development requests made while Domain restriction is enabled do not consume production views. With Domain restriction disabled, local requests follow the normal usage-counting flow.

Before deploying, remove `devToken` from the snippet configuration. Production domains use the normal domain and browser-verification flow.
