Integrate physical presence in 5 minutes
Everything you need to generate dynamic venue tokens, verify attested mobile handshakes, and validate signed webhooks.
Three-Step Quickstart
Go from zero to your first cryptographically verified physical session.
Define a geofenced venue perimeter
Register nested coordinates, meter radius (10–250m GPS or 1–50m BLE/Loadcell), and hardware profile.
const venue = await setsig.venues.create({ name: "Istanbul Arena Gate 04", coordinates: { latitude: 41.00824, longitude: 28.97836, radiusMeters: 35, }, hardwareProfile: "STANDARD_GPS", settings: { totpIntervalSeconds: 30, allowMockLocations: false },});Render dynamic TOTP QR on terminal
Drop the zero-dependency kiosk script or call /v1/tokens/generate every 30–60 seconds.
const token = await setsig.tokens.generate({ venueId: venue.id, ttlSeconds: 30, bindToClientToken: "tkt_live_894102",});// token.qrPayload -> "setsig:v1:tok_0196a3f2:1793887200:7a9f82d1c4e05b93"Verify mobile telemetry & seal proof
Submit scanned qr_payload, client_binding, telemetry, and hardware enclave attestation for sub-15ms verification.
const session = await setsig.sessions.verify({ qrPayload: token.qrPayload, clientBinding: { clientToken: "tkt_live_894102", userHash: "usr_77192" }, telemetry: { latitude: 41.00825, longitude: 28.97837, accuracyMeters: 4.1 }, attestation: { platform: "ios_app_attest", token: deviceAttestToken },});Official SDK Ecosystem
Type-safe packages across server, web, native mobile, and standalone kiosk environments.
Passive DNS TXT Domain Verification
Lock webhook origins and browser CORS policies to verified corporate domains via _setsig-challenge TXT records without SSL proxy changes.
_setsig-challenge.yourdomain.comsetsig-ver=98f2a10c4d7b3e19a04c82d1f6b5e301Core REST Endpoints
Deterministic JSON endpoints authenticated via Bearer secret or publishable keys.
| Endpoint | Auth / Scope | Description |
|---|---|---|
POST/v1/tokens/generate | Bearer API Key | Generate a 30–60s dynamic TOTP presence QR payload (setsig:v1:tok_...) with optional client token binding. |
POST/v1/sessions/verify | Bearer API Key | Atomically verify physical presence against Haversine radius, TOTP window, enclave attestation, and visual proof. |
POST/v1/sessions/verify-intent | Bearer API Key | Acquire a short-lived presigned upload URL and storage_key for ≤ 10s visual proof camera snapshots. |
POST/v1/terminals/session | Terminal Key | Initialize an authenticated gatekeeper terminal or standalone kiosk display session. |
GET/v1/venues | venues:read | List geofenced venue perimeters, radii, and hardware attestation policies. |
POST/v1/venues/{id}/rotate-secret | venues:admin | Rotate venue HMAC seed and immediately invalidate active challenge tokens. |
POST/v1/domains/{id}/verify | Owner / Developer | Trigger live DNS TXT resolution against _setsig-challenge to confirm corporate domain ownership. |
GET/v1/billing/balance | Owner / Auditor | Query real-time prepaid credit balance, runway estimate, and billing zone. |
Device Attestation Platforms
Supported values for attestation.platform in POST /v1/sessions/verify. Hardware attestation verifies that telemetry originates from an untampered physical device.
| Platform Value | Runtime | Description |
|---|---|---|
| ios_app_attest | Native iOS | Cryptographic hardware assertion backed by Apple Secure Enclave and App Attest. Recommended for native iOS applications. |
| google_play_integrity | Native Android | Google Play Integrity JWS or JWE verdict validating genuine app binary and physical device integrity on Android. |
| web_none | Browser / Web | Browser-based check-in flow without hardware enclave attestation. Accepted only on venues whose policy permits web-based verification. |
Webhook HMAC-SHA256 Verification
Every asynchronous session.verified event carries X-Setsig-Signature: t=[unix],v1=[hex] computed over t=[unix].[rawBody]. Always validate with constant-time comparison.
import { createHmac, timingSafeEqual } from "node:crypto"; /** * Validates X-Setsig-Signature: t={unix_timestamp},v1={hex_hmac} * Matches setsig-backend worker payload: HMAC_SHA256(secret, "t=" + timestamp + "." + rawBody) */export function verifySetsigWebhook( rawBody: string, signatureHeader: string, secret: string, toleranceSeconds = 300): boolean { const parts = Object.fromEntries( signatureHeader.split(",").map((kv) => kv.trim().split("=")) ); const timestamp = Number(parts.t); const signatureHex = parts.v1; if (!timestamp || !signatureHex) return false; if (Math.abs(Math.floor(Date.now() / 1000) - timestamp) > toleranceSeconds) { return false; } const expectedHex = createHmac("sha256", secret) .update(`t=${timestamp}.${rawBody}`, "utf8") .digest("hex"); const a = Buffer.from(signatureHex, "utf8"); const b = Buffer.from(expectedHex, "utf8"); return a.length === b.length && timingSafeEqual(a, b);}Deterministic Error & Paywall Codes
Machine-readable error_code responses localized across supported languages via Accept-Language.
| HTTP | Error Code | Resolution & Trigger |
|---|---|---|
| 400 | ERR_STALE_VISUAL_PROOF | Camera capture timestamp exceeded the strict 10-second freshness gate. |
| 400 | ERR_INVALID_IMAGE_HASH | Uploaded cloud object failed 64-character SHA-256 digest verification. |
| 402 | ERR_PAYWALL_BLOCKED | Tenant prepaid credit balance depleted; returns PaywallBlockedDetails and X-Setsig-Billing-Status. |
| 403 | ERR_GEOFENCE_OUT_OF_BOUNDS | Device spherical Haversine distance exceeds configured venue radius_meters. |
| 403 | ERR_ATTESTATION_FAILED | Apple App Attest or Google Play Integrity check failed, or mock location detected. |
| 409 | ERR_REPLAY_DETECTED | Token ID already claimed by the distributed atomic replay lock or recorded in the immutable verification ledger. |