Use the SDK
@offline-protocol/pol (0.1.2) submits the commitment and completes the operator witness exchange. It works in React, Next.js and React Native. You supply the App ID, an OfflineID user JWT and the coordinates; the SDK does not sign users in.
transpilePackages in next.config:
pol.location.commit({ claim }) when you need only the onchain commitment, without a witness attestation. A ProofOfLocationProvider and useProofOfLocation hook are available for React, and @offline-protocol/pol/wasm provides an optional WASM client for Next.js, covered by the same transpilePackages entry. Validate the returned attestation as described below before relying on it.
Submit with the raw API
{ "message": "...", "data": { ... } }, with operators, id, transaction, commitment and geoHash inside data. A 200 confirms task submission, not witness acceptance.
id is the random task ID. See task identifiers for its format and how to match it to an attestation.
Witness exchange
This describes the operator’s raw protocol, which@offline-protocol/pol implements for you. The older identity SDK hooks do not. The operator must have observed and cached the submitted onchain task before handling the exchange.
- Connect to a provisioned operator’s WebSocket. Returned URLs can use
https://; map that scheme towss://(orhttp://tows://for an approved local test), retaining the host and configured path. Do not pass an HTTPS URL directly to a WebSocket constructor. - Send
{ "type": "ping", "id": "<data.id>", "claimedLocation": { "lat": 51.5074, "lon": -0.1278 } }. - On
{ "type": "pong" }, promptly send{ "type": "ack" }. The operator measures this round trip. - Read
{ "type": "attestation", "attestation": ... }. Validate signer, chain, deployment, task, commitment, result and freshness before accepting it. See individual results.
Released SDK limitations
Use@offline-protocol/pol for Proof of Location. React Native 0.3.3 removes useProofOfLocation and React 0.2.0 removes useLocation. The hooks in older versions omit the required witness id and ignore attestation replies. Do not rely on them for witness evidence.
The gateway now maps older SDKs’ x-project-id to X-App-Id. Direct API clients must send X-App-Id as shown above. Hosted usage-limit enforcement is active; header compatibility does not repair the older hooks’ witness exchange.
Handle errors
The API maps other upstream 5xx responses to 502; it does not forward every upstream 500 unchanged.

