> For the complete documentation index, see [llms.txt](https://docs.luasec.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.luasec.org/licensing/ad-rewards.md).

# Ad rewards

Let users **earn a temporary key** by passing through ad links. They complete a few checkpoints, and on the last one Luasec mints a temporary key and drops them on a page to copy it.

<figure><img src="https://2693759722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYgaUmQ3XhIuFeXi2dUN%2Fuploads%2Fs0FEqOPhebw0Y3L2lUmP%2Fimage.png?alt=media&amp;token=1859a580-e12a-4521-b51f-5d72e60d1b89" alt="" width="341"><figcaption></figcaption></figure>

## How it works

1. A user opens your getkey page: `https://luasec.org/getkey/<project-public-id>`.
2. They pass ***n*****&#x20;checkpoints:** each one wraps a callback in an adlink provider.
3. On the **final** checkpoint, the server verifies the provider's anti bypass proof, mints a key valid for `rewardHours`, and shows it.

## Providers

| Provider        | Notes                                                                             |
| --------------- | --------------------------------------------------------------------------------- |
| **Linkvertise** | Needs your Linkvertise account id (and an API token for antibypass verification). |
| **Lootlabs**    | Mints a content locker link via the Lootlabs API and needs your API key.          |
| **Work.ink**    | Needs your Work.ink API key.                                                      |

You can chain multiple providers across checkpoints.

## Setting it up

On your project's **ad-reward** settings:

* **Enable** the gateway.

<figure><img src="https://2693759722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYgaUmQ3XhIuFeXi2dUN%2Fuploads%2Fi25BvbxfcfmnTyOSUKuP%2Fimage.png?alt=media&amp;token=a6c1f9eb-1527-426b-92db-7b2b4a598102" alt=""><figcaption></figcaption></figure>

* **Checkpoints:** how many steps (1–10).

<figure><img src="https://2693759722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYgaUmQ3XhIuFeXi2dUN%2Fuploads%2FumStHv7pLKOw4RC5YVtx%2Fimage.png?alt=media&amp;token=816b63c7-acf7-40b4-9f72-eee171510052" alt=""><figcaption></figcaption></figure>

* **Providers:** which provider(s) to use across the steps.

<figure><img src="https://2693759722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYgaUmQ3XhIuFeXi2dUN%2Fuploads%2FGoAauMlS7pfxKwVfRrT5%2Fimage.png?alt=media&amp;token=5d0fdea3-ff11-4fea-b472-78edcc355951" alt=""><figcaption></figcaption></figure>

* **Reward hours:** how long the minted key lasts.

<figure><img src="https://2693759722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYgaUmQ3XhIuFeXi2dUN%2Fuploads%2FatbyfpQN6V1RsUBUTLM6%2Fimage.png?alt=media&amp;token=b192a9be-0509-4bbf-a1c5-df1aa0837a31" alt=""><figcaption></figcaption></figure>

* **Provider credentials:** your account id / API keys for the providers you use.
* **Work.ink link:** Work.ink has no API for creating links, so create one in your Work.ink dashboard and paste it here. Without it the gateway can't build a link, however valid your API key is. (LootLabs works the same way if you'd rather use your own loot-link than the auto-created one.)

<figure><img src="https://2693759722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYgaUmQ3XhIuFeXi2dUN%2Fuploads%2Fzd689kTTs08CryQR0Z5m%2Fimage.png?alt=media&amp;token=c244c244-ebb2-447f-a0df-6d8693a1fc40" alt=""><figcaption></figcaption></figure>

## Notes

* Adreward keys are ordinary keys with an expiry. They're HWID locked and bannable like any other.
* The HWID lock is applied the first time the key runs, not when it's handed out. The get-key page runs in a browser and can't see a device HWID, so there's nothing meaningful to lock to until the script actually starts.
* Keep `rewardHours` modest because users can re-run the flow to renew.
* **House ads:** the get-key page can carry platform ads, with the number of slots set by the hub owner's plan: Free 4, Pro 2, Max 1. A lapsed plan counts as Free from the moment it lapses. For AdSense set `GETKEY_ADSENSE_CLIENT` and `GETKEY_ADSENSE_UNITS` on the API; for any other network set `GETKEY_AD_TAG` to its tag. With none set, no ads are shown.
* **Ad blockers:** `GETKEY_ADBLOCK_MODE` on the API - `off` (default), `warn` (say the page won't earn but let them through) or `block` (hold the run until it's off). Detection combines a bait element and a network probe, so it catches both cosmetic filtering and DNS-level blocking. It is inference rather than fact, so `block` will occasionally turn away someone with a privacy browser or a filtered network.
* **Bot protection:** set `TURNSTILE_SITE_KEY` and `TURNSTILE_SECRET_KEY` on the API (both from the Cloudflare Turnstile dashboard, with your get-key hostname added to the widget's allowed domains) and visitors must clear a challenge before a run can start. This is platform-wide rather than per hub. With no secret set, no challenge is shown.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.luasec.org/licensing/ad-rewards.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
