01 / DEPLOYMENT OVERVIEW
Understand the security model
There is no public browser API key. Your backend uses a long-lived private credential only to request a short-lived session token. The browser receives only that temporary token and its binding.
| Component | Runs in | Purpose |
|---|
| Private server key | Your backend only | Authenticates requests to issue sessions and perform other protected server operations. Never expose it in HTML, JavaScript, visitor-visible content, logs, URLs, Git repositories, or mobile apps. |
| Session token | Visitor browser, for one check | An opaque random token valid for about 60 seconds. It is bound to the workspace, exact page origin, session binding, and one observation. |
| Browser SDK | Visitor browser | Collects signals after consent and submits one observation with the temporary token. |
| Signed assertion | Visitor browser to your backend | Carries signed identity evidence returned by DeviceDNA. Your backend must verify it before applying policy. |
02 / CONSOLE SETUP
Create the workspace
- Register or sign in at the DeviceDNA console.
- Create or select the workspace that represents the website or product you want to protect.
- Use a clear workspace name so operators can identify it later.
- Confirm the displayed tenant key. It is a public workspace identifier, not a secret; use it only in integrations for that workspace.
- Use the console's language switcher to read this guide in English or Simplified Chinese.
Important: the workspace is tenant-scoped. Device IDs, signatures, clusters, observations, quota, and credentials must never be treated as global identifiers across customers.
03 / TRUSTED ORIGINS
Configure the browser page's exact origin
Open Trusted origins in the workspace sidebar and add the exact origin of every page where the SDK will run. An origin consists of the scheme, hostname, and port; it never includes a path.
| Correct example | Explanation |
|---|
https://shop.example.com | Production website origin. |
https://www.shop.example.com | A separate origin from the hostname without www. |
http://localhost:5173 | Local development origin with an explicit port. |
https://preview.example.com | Separate preview deployment. |
Do not append a path, use a wildcard, or assume that one port covers another. Add each port as a separate origin. Remove origins your team no longer controls.
04 / PRIVATE KEY
Create and protect the server credential
- Open API keys in the workspace sidebar.
- Click Create private key. Keep only one active private key for the workspace.
- Copy the full value immediately. DeviceDNA shows the secret only once.
- Store it in an environment variable or secret manager on your backend.
- Do not commit it, write it to request logs, place it in browser bundles, or paste it into support tickets.
- If exposure is suspected, revoke it, create a replacement, update the backend secret, and redeploy.
DEVICEDNA_PRIVATE_KEY=ddna_private_live_replace_me
05 / REQUEST FLOW
Understand what runs where
01 / YOUR SERVERIssueAuthenticate with the private key and request a DeviceDNA session for the exact page origin and your application's authenticated user session.
02 / VISITOR BROWSERCollectReceive only the temporary token and binding, then run the SDK after consent.
03 / DEVICEDNAMatchReject invalid or replayed credentials before metering, then normalize and match the observation.
04 / YOUR SERVERDecideVerify the signed assertion and combine it with account, payment, anti-cheat, and behavioral evidence.
Never let the browser make the final security decision. A browser can display a result, but your server must decide whether to allow, challenge, limit, review, or reject an account action.
06 / SERVER: ISSUE A SESSION
Call the DeviceDNA API from your backend
Generate a fresh random binding for your application's authenticated user session. Send the private key in the Authorization header. This request must be made by your backend, never directly from browser JavaScript.
import crypto from "node:crypto";
const binding = crypto.randomBytes(32).toString("base64url");
const session = await fetch("https://www.devicedna.site/v1/session", {
method: "POST",
headers: {
"content-type": "application/json",
"authorization": `Bearer ${process.env.DEVICEDNA_PRIVATE_KEY}`
},
body: JSON.stringify({
tenantKey: process.env.DEVICEDNA_TENANT_KEY,
origin: "https://shop.example.com",
binding
})
}).then(async (response) => {
const body = await response.json();
if (!response.ok) throw new Error(body.message || body.error || "Session issuance failed");
return body;
});
// Return only session.token and session.binding to the authenticated page.
The origin must exactly match the origin of the page that will run the SDK. Associate the binding with the same authenticated user session in your application.
Session response
{
"token": "ddna_sess_...",
"binding": "the-same-random-binding",
"expiresAt": "2026-08-22T12:00:00.000Z",
"tenantKey": "tenant_...",
"origin": "https://shop.example.com"
}
07 / BROWSER: RUN ONE CHECK
Pass only the temporary token and binding
Host the built SDK on your own website and load it in the visitor's browser. The browser does not need the workspace's private key. Pass only the session token and binding returned by your backend.
import { identifyDevice } from "/device.js";
const identity = await identifyDevice(
"https://www.devicedna.site",
"tenant_your_workspace_key",
sessionToken,
sessionBinding
);
await fetch("/your-server/device-check", {
method: "POST",
headers: { "content-type": "application/json" },
credentials: "include",
body: JSON.stringify({ assertion: identity.assertion })
});
Run it only after satisfying your website's consent requirements and, where applicable, visitor-authentication requirements. Do not put a long-lived DeviceDNA credential in localStorage, cookies accessible to JavaScript, or a public configuration file.
08 / SESSION SAFETY
What DeviceDNA rejects before counting usage
- Missing, malformed, or unknown session token
- Expired token after approximately 60 seconds
- Token already consumed by another observation
- Tenant in the observation differs from the token tenant
- Declared origin differs from the request origin
- Origin was not allowed for the tenant
- Session binding is missing or does not match
- Nonce replay or malformed observation
Only an accepted observation counts toward workspace usage. Treat invalid-token traffic as abuse traffic and rate-limit it at the edge proxy and by authenticated user session, IP address, origin, and workspace.
09 / FINALIZE ON YOUR SERVER
Verify the assertion and apply policy
Send the assertion to your backend through the same authenticated application session. Associate it with the session that requested the DeviceDNA token, then call the server-side session-status flow or an equivalent verification endpoint.
// Pseudocode: do not trust identity fields copied from the browser.
const decision = await verifyWithDeviceDNA({
tenantKey: process.env.DEVICEDNA_TENANT_KEY,
privateKey: process.env.DEVICEDNA_PRIVATE_KEY,
assertion: request.body.assertion,
expectedCustomerSession: request.session.id
});
if (decision.recommendation === "challenge") {
// Require a passkey, password, email code, or other step-up check.
}
// Keep irreversible bans behind corroborating evidence and review.
Recommended policy: use DeviceDNA as supporting evidence. Before an irreversible action, combine it with account history, payment signals, verified account ownership, anti-cheat telemetry, and behavioral evidence.
Identity fields to retain
Use deviceId or deviceClusterId as the device-cluster reference within the current workspace. browserProfileId identifies one browser profile. Use confidence, status, integrity, and reasonCodes to understand why the decision was returned. None of these fields is a hardware serial number.
10 / TEST THE INSTALLATION
Use the authenticated test lab
- Sign in to the DeviceDNA console.
- Open Test lab. The current browser integration does not use a public key, so the lab does not ask for one.
- The dashboard creates a short-lived test session on the server and runs the same SDK and matcher used in production.
- Run the test in Chrome or Edge, then repeat it in another ordinary browser on the same computer.
- Compare the device cluster, status, confidence, and integrity together. A new browser profile is expected to have a different
browserProfileId.
An exact result usually means the persisted browser identifier matched. probable means cross-browser evidence supports the relationship. uncertain means the service will not force a cluster merge.
12 / TROUBLESHOOTING
Common errors and fixes
| Error | Likely cause | Fix |
|---|
Origin is not allowed | The scheme, hostname, or port does not exactly match a trusted origin. | Add the page's exact origin without a path, then request a fresh session. |
A short-lived session token is required | The browser sent no token, a legacy public key, a revoked key, or an expired token. | Have the backend issue a fresh session immediately before collection. |
Invalid session binding | The binding sent by the browser differs from the value used when the session was issued. | Keep the binding with the same authenticated user session and pass it unchanged. |
Session expired or already used | Collection started too late, or the same token was submitted more than once. | Issue one fresh token per observation; never retry with a token that has already been used. |
13 / HARD LIMITS
DeviceDNA's limits
- A website cannot obtain the device's motherboard serial number through the browser.
- Incognito sessions, cleared storage, privacy browsers, VPNs, OS updates, display-setting changes, and anti-detect profiles can reduce the available evidence.
- A coherent anti-detect profile that spoofs every exposed signal may be indistinguishable from another device. DeviceDNA should return
uncertain rather than claim certainty. - Devices with identical configurations can produce similar model-level signals. Do not merge clusters or ban users based solely on a single vector that appears to represent hardware characteristics.
- DeviceDNA does not replace passwords, passkeys, account verification, payment verification, anti-cheat telemetry, or human appeal procedures.