128KB browser SDK — load(), get(), configuration options, and signal collection lifecycle
npm install @tracio/clientimport Tracio from '@tracio/client';const tracio = await Tracio.load({ apiKey: 'your-api-key', endpoint: 'https://your-server.com/api', region: 'eu', // 'us' | 'eu' | 'ap' timeout: 10000, // ms});| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | required | Your API key |
endpoint | string | auto | Custom server endpoint URL |
region | string | "us" | Server region |
timeout | number | 10000 | Request timeout in milliseconds |
Tracio.load(options)Initialize the SDK and begin signal collection. Returns a promise that resolves to the tracio.ai agent instance.
tracio.get(options?)Collect signals and return identification results. Options:
| Option | Type | Description |
|---|---|---|
extendedResult | boolean | Return additional metadata (bot detection, IP info, smart signals) |
tag | object | Custom metadata attached to this event |
linkedId | string | Link this event to an external identifier |
// Basic result{ visitorId: "X7fh2Hg9LkQp3Nv", confidence: { score: 0.995 }, requestId: "1710432000_abc123def",}// Extended result (extendedResult: true){ visitorId: "X7fh2Hg9LkQp3Nv", confidence: { score: 0.995 }, requestId: "1710432000_abc123def", bot: { result: "notDetected", probability: 0.0 }, ipLocation: { city: { name: "Prague" }, country: { code: "CZ", name: "Czechia" }, latitude: 50.05, longitude: 14.4, }, incognito: false, vpn: { result: false },}try { const result = await tracio.get();} catch (error) { if (error.message === 'timeout') { // Request timed out — retry or proceed without fingerprint } else if (error.message === 'network_error') { // Network unavailable } else { // Unexpected error console.error('tracio.ai error:', error); }}