Skip to main content
DEVELOPER DOCUMENTATION

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.

STEP 01

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 },
});
STEP 02

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"
STEP 03

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.

Node.js / TypeScriptESM / Node 20+
npm install @setsig/node
React / Next.jsReact 19 / RSC
npm install @setsig/react
GoGo 1.23+
go get github.com/setsig/setsig-go@latest
PythonPython 3.10+
pip install setsig-sdk
iOS SwiftApp Attest
https://github.com/setsig/setsig-ios.git
Android KotlinPlay Integrity
implementation("com.github.setsig:setsig-android:1.0.0")
Browser SDKWeb Crypto
npm install @setsig/browser
Standalone Kiosk CDNZero-Dep
https://cdn.setsig.com/kiosk/setsig-kiosk.js

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.

TXT Host Record
_setsig-challenge.yourdomain.com
TXT Challenge Value
setsig-ver=98f2a10c4d7b3e19a04c82d1f6b5e301

Core REST Endpoints

Deterministic JSON endpoints authenticated via Bearer secret or publishable keys.

EndpointAuth / ScopeDescription
POST/v1/tokens/generate
Bearer API KeyGenerate a 30–60s dynamic TOTP presence QR payload (setsig:v1:tok_...) with optional client token binding.
POST/v1/sessions/verify
Bearer API KeyAtomically verify physical presence against Haversine radius, TOTP window, enclave attestation, and visual proof.
POST/v1/sessions/verify-intent
Bearer API KeyAcquire a short-lived presigned upload URL and storage_key for ≤ 10s visual proof camera snapshots.
POST/v1/terminals/session
Terminal KeyInitialize an authenticated gatekeeper terminal or standalone kiosk display session.
GET/v1/venues
venues:readList geofenced venue perimeters, radii, and hardware attestation policies.
POST/v1/venues/{id}/rotate-secret
venues:adminRotate venue HMAC seed and immediately invalidate active challenge tokens.
POST/v1/domains/{id}/verify
Owner / DeveloperTrigger live DNS TXT resolution against _setsig-challenge to confirm corporate domain ownership.
GET/v1/billing/balance
Owner / AuditorQuery 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 ValueRuntimeDescription
ios_app_attestNative iOSCryptographic hardware assertion backed by Apple Secure Enclave and App Attest. Recommended for native iOS applications.
google_play_integrityNative AndroidGoogle Play Integrity JWS or JWE verdict validating genuine app binary and physical device integrity on Android.
web_noneBrowser / WebBrowser-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.

webhook-handler.ts
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.

HTTPError CodeResolution & Trigger
400ERR_STALE_VISUAL_PROOFCamera capture timestamp exceeded the strict 10-second freshness gate.
400ERR_INVALID_IMAGE_HASHUploaded cloud object failed 64-character SHA-256 digest verification.
402ERR_PAYWALL_BLOCKEDTenant prepaid credit balance depleted; returns PaywallBlockedDetails and X-Setsig-Billing-Status.
403ERR_GEOFENCE_OUT_OF_BOUNDSDevice spherical Haversine distance exceeds configured venue radius_meters.
403ERR_ATTESTATION_FAILEDApple App Attest or Google Play Integrity check failed, or mock location detected.
409ERR_REPLAY_DETECTEDToken ID already claimed by the distributed atomic replay lock or recorded in the immutable verification ledger.

Control which cookie categories are active during your visit. You can update your choices at any time from the footer.

Strictly NecessaryAlways Active

Required for language selection, security headers, and storing your consent preferences. Cannot be disabled.

Analytics & Performance

Helps us understand page visits, latency, and navigation patterns through Google Analytics and Tag Manager.

Campaign Measurement

Measures referral attribution and campaign effectiveness across external marketing channels.