DEVELOPER DOCUMENTATION / V1

SDK documentation

01 / GET CONNECTED

Quickstart

  1. Create a public key.

    Sign in to your API keys page and add each exact website origin that can submit browser assessments. Copy the key when it is shown.

  2. Load the SDK.

    Add the script to your page. Loading it alone does not collect signals or send an assessment.

    HTML
    <script src="https://identifai.ca/v1.js"></script>
  3. Assess a meaningful event.

    Call the SDK after it has loaded and when you have the appropriate permission to collect device signals. Keep user IDs pseudonymous; never use an email address or password.

    JavaScript
    const result = await Identifai.assess({
      apiKey: "pk_your_public_key",
      event: "signup",
      userId: "customer_123" // optional account reference
    });
    
    console.log(result.visitor_id, result.risk_score);
Local development or a different API host?

Pass endpoint: "https://identifai.ca/v1/assess" to assess(), or set data-api-url to the same complete assessment URL on the SDK script. HTTPS is required except on loopback hosts.

02 / API REFERENCE

Assessment API

POSThttps://identifai.ca/v1/assess

Send JSON with a public API key, an event name, and browser signals. The server records its own request time, source IP, user agent, and customer. A client-supplied IP field is never authoritative.

FieldTypeDescription
api_keystring · requiredYour active public key.
eventstring · requiredA short event name such as signup or login.
user_idstring · optionalYour pseudonymous account reference. Stored as a keyed hash.
signalsobject · requiredAllowlisted browser/device characteristics. Use the SDK to collect them.
cURL · replace the key and Origin
curl -X POST 'https://identifai.ca/v1/assess' \
  -H 'Content-Type: application/json' \
  -H 'Origin: https://your-website.example' \
  --data '{
    "api_key": "pk_your_public_key",
    "event": "signup",
    "user_id": "customer_123",
    "signals": {
      "language": "en-CA",
      "timezone": "America/Vancouver",
      "screen": {"width": 1440, "height": 900},
      "colorDepth": 24,
      "hardwareConcurrency": 8,
      "platform": "MacIntel"
    }
  }'

This minimal example illustrates the request format. Low-information signals may not be sufficient to recognize a device. API keys are public; Origin checks are a browser control, not proof of a caller’s identity.

03 / THE RESULT

Reading the response

Illustrative JSON response
{
  "visitor_id": "dev_example",
  "confidence": 0.91,
  "risk_score": 30,
  "returning": true,
  "signals": {
    "account_velocity": false,
    "ip_velocity": false,
    "device_reuse": true
  }
}
visitor_id
An internal device identifier scoped to your customer. It remains stable when a likely match is found.
confidence
A heuristic estimate from 0 to 1. It is not a calibrated probability or a guarantee that two visits share a device.
risk_score
A rule-based score from 0 to 100. Review its reasons in the dashboard; a low score does not prove that activity is safe.
returning
Whether this assessment matched a previously seen device in your workspace.
signals
Risk indicators triggered by the assessment. These are separate from raw browser signals.
04 / UNDER THE SURFACE

Matching & risk

Identifai compares normalized signals against a bounded set of recently seen devices in the same customer workspace. WebGL and canvas-derived signals carry more weight; display, timezone, hardware, and language contribute supporting evidence. Missing or common signals alone are not enough to make a strong match.

The risk engine evaluates account reuse, signup bursts, IP velocity, device changes, and a workspace’s manual suspicious flag. Individual rules add points, capped at 100, and the dashboard retains an explanation for each contribution.

0–29 · Low

Few configured risk indicators.

30–69 · Medium

Patterns worth reviewing.

70–100 · High

Several or stronger risk indicators.

Use device assessments as one input alongside your own account and transaction context. Shared household devices, public computers, privacy protections, and changing networks can produce false positives or missed matches. The MVP does not provide IP reputation, VPN detection, legal identity verification, or a machine-learning fraud probability.

05 / HANDLE THE EDGES

Errors & limits

StatusWhat to check
400Check required fields, event format, signal values, and JSON.
401The public key is missing, invalid, or revoked.
403The browser origin is not allowed for this key.
413The request body exceeds the configured size limit.
429Rate limit exceeded. Respect the Retry-After header.
503The service is temporarily unavailable. Avoid blocking your whole flow on an assessment.

The SDK rejects its promise on network errors, timeouts, and non-success API responses. Handle failures explicitly. It does not automatically retry, because repeating a signup event would affect velocity counts.

JavaScript · handle an unavailable assessment
try {
  const result = await Identifai.assess({
    apiKey: "pk_your_public_key",
    event: "login"
  });
  // Apply your own review policy using result.
} catch (error) {
  // Apply your application's fallback policy.
  console.error("Assessment unavailable");
}
06 / RESPONSIBLE INTEGRATION

Privacy & deployment

The SDK observes normal browser characteristics without asking for location, contacts, files, passwords, or other domains’ cookies. Include the collection in your own privacy information and configure your consent flow for your use case.

Customer user IDs and source IPs are stored as keyed hashes for matching. The dashboard displays pseudonymous account references and masked IP labels. Browser signals and assessment history are retained for 365 days under the current configuration. Workspace controls can delete data for an account or a device.

Identifai’s public pages offer optional Google Analytics. The assessment SDK does not load Google Analytics, and dashboard activity is excluded. See the privacy overview for more detail.

Try a real assessment