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

# Reese84 in depth

> What the sensor is, how the two site variants differ, how the GPC puzzle fits in, and how to keep a token alive.

The [Quickstart](https://docs.roolink.io/imperva/quickstart.md) runs the Reese84 flow once. This page explains the parts, so you can recognize the variants, handle the puzzle, and keep a session going for hours rather than minutes.

## How to recognize a Reese84 site

Any of these means the site runs Reese84:

* A cookie named `reese84` in a browser session.
* A `POST` in your powhttp recording to a URL ending in `?d=<host>` with a JSON body and a JSON reply containing `token`.
* On some sites, API requests carrying an `x-d-token` header with the same value as the cookie.

The sensor script lives at a fixed but random-looking path on the site's own host. The submission goes to the same URL with `?d=<host>` appended.

## Two variants

| | Static | Dynamic |
| - | - | - |
| What the visitor sees | Nothing. The script runs in the background on a normal page. | A "Pardon Our Interruption" interstitial before the real page. |
| Where the script URL is | A plain `<script src="/…">` tag in the page. | Assigned in a small loader: `scriptElement.src = "…"`. The path may be escaped; unescape it before use. |
| Proof of work | Rarely. | Usually. Fetch it with the GPC probe and pass it to Roolink. |
| Roolink call | `/payload` with `script`, `scriptUrl`, `pageUrl`, `userAgent`, `language`. | The same, plus `pow`. |

The flow is identical either way. The Quickstart's script finder handles both shapes, and the GPC probe returns an empty string on sites that do not use it, so one implementation covers both.

## The GPC puzzle

Sites can require a small proof of work before they accept a submission. The browser asks for it by posting `{"f":"gpc"}` to the script URL with `?d=<page host>`. The reply is a JSON string: empty when there is no puzzle, otherwise a base64 envelope containing a 16-byte seed and a SHA-1 target.

Pass that string to Roolink as `pow`, exactly as received. Roolink solves it while building the submission and includes the proof where the site expects it. Do not decode or solve it yourself; a pre-solved proof is not accepted. The solve is bounded at ten seconds, and a puzzle that runs past it returns `504`; retry once.

## The token

The submission reply is JSON with three fields you use:

| Field | What to do |
| - | - |
| `token` | Store it as a cookie named `reese84` and send it on every request. It looks like a digit, a colon and a long string. |
| `cookieDomain` | The domain to set the cookie on. Fall back to the page host when absent. |
| `renewInSec` | How long the token is good for, in seconds. Renew before then. |

On sites whose API calls carry `x-d-token`, send the same token in that header too. Your recording shows which requests need it.

## Renewing

A token is a session, not a one-off. To keep it alive, repeat the fetch-build-submit cycle in the same session before `renewInSec` elapses, and replace the cookie with the new token. Renewal does not need a fresh page load: the script URL is stable per site, so cache it, fetch the script again to pick up any change, probe GPC, build, submit. Roolink's `/payload` response carries an `old_token` field for compatibility with the browser's submission shape; you do not need to fill it in.

## What Roolink emulates

Roolink builds the Reese84 submission from a real browser that visited a site recently and sent the same User-Agent you pass in `userAgent`, and takes the languages and time zone from `language`. Send a current desktop Chrome User-Agent from Windows or macOS, with matching client hints and the newest Chrome TLS profile your client offers. A User-Agent no collected browser has, such as an old Chrome version or Linux, gets `422 device_not_found`. The [Supported browsers](https://docs.roolink.io/supported-browsers.md) page has the details.

## Request fields

| Field | Required | What it does |
| - | - | - |
| `script` | yes | The sensor script exactly as fetched. |
| `scriptUrl` | yes | The URL it was fetched from. May be relative to `pageUrl`. |
| `pageUrl` | yes | The absolute HTTPS URL of the page. |
| `userAgent` | yes | The User-Agent your requests to the site send. |
| `language` | yes | The `Accept-Language` header your requests send, such as `en-US,en;q=0.9`. |
| `pow` | no | The raw base64 string from the GPC probe. Omit, or send `null` or `""`, when the site has no puzzle. |

## Troubleshooting

> [accordion] Roolink answers 400 with invalid\_pow
>
> The `pow` value is not the raw string the GPC probe returned. Send it untouched: no decoding, no whitespace, no solving.

> [accordion] Roolink answers 422 for the script
>
> The script was altered in transit, or it is a build Roolink does not support yet. Send the exact body, and if it persists bring the script URL to [Discord](https://discord.gg/rooapi).

> [accordion] Tokens are accepted but expire faster than renewInSec
>
> The IP changed mid-session, or the User-Agent differs between the page load and the submission. Both invalidate the token early.

> [accordion] The interstitial keeps coming back
>
> On dynamic sites, confirm the GPC probe returned a puzzle and that you passed it to Roolink. A submission built without the proof is refused, and the site shows the interstitial again.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.