> ## Documentation Index
> Fetch the complete documentation index at: https://docs.veriox.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy the Worker

> Deploy the Veriox Cloudflare Worker to your account with Wrangler.

The Veriox Worker is a lightweight Cloudflare Worker that runs on your account, under your domain. It intercepts page requests, checks for a valid session cookie, and injects the verification trigger when needed.

## 1. Get your private key and worker code

In [portal.veriox.io](https://portal.veriox.io), go to **Workers** and create a new worker (or open an existing one).

* Copy the **private key** shown after creation — it's displayed **only once**. Your worker signs every request with it; Veriox only ever stores the matching public key.
* On the worker's **Install** page, click **Download worker** to get `veriox-worker.js`. This file is personalised to your worker — your **Worker ID is already built in**.

<Warning>
  Keep your private key secret and never commit it to version control. You'll set it as a Cloudflare Worker secret (not a plain variable) so it's encrypted and never exposed in logs or source.
</Warning>

## 2. Create a project

Put the downloaded `veriox-worker.js` in a new folder alongside a `wrangler.toml`:

```toml theme={null}
name = "my-site-age-verification"
main = "veriox-worker.js"
compatibility_date = "2024-05-01"
compatibility_flags = ["nodejs_compat"]
```

There are no settings to configure here — your Worker ID is baked into the code, and all verification options (age threshold, session length, trigger and location targeting) are managed in the portal.

## 3. Set your private key as a secret

```bash theme={null}
wrangler secret put VERIOX_PRIVATE_KEY
```

Paste your private key when prompted. This stores it encrypted in Cloudflare — it is not visible after this point. This is the only secret you need to set.

## 4. Deploy

```bash theme={null}
wrangler deploy
```

Wrangler will output the worker URL. The worker is now deployed to your Cloudflare account and ready to be routed.

## Next step

[Configure your site](/installation-wrangler/configure-your-site) — add the Cloudflare Worker Route so requests flow through Veriox.
