Client SDKs
@nexiel/sdk (TypeScript) and nexiel-sdk (Python) give you one client per service, with request and response types that match each service's OpenAPI document, typed errors, and Authorization and Idempotency-Key header handling. Both wrap the same Screen API and Verify API documented on this site.
Install
npm install @nexiel/sdkpip install nexiel-sdkEvery route is also plain JSON over HTTPS, so fetch, requests or any HTTP client works without an SDK. Start with the quickstart and Authentication.
What waitForSessionCompletion adds
Both SDKs expose the Verify API primitives directly: initiateSession, getSession, listSessions, submitSessionResponse, completeRedirectReturn for same-device sessions, and rpIdentity (rp_identity in Python) for your relying-party identity and certificates. After initiateSession, every wallet integration needs to wait until the user's wallet has responded. waitForSessionCompletion (TypeScript) and wait_for_session_completion (Python) poll getSession on an interval until the session has finished (past 'pending' and 'awaiting_redirect'), and return the final session, including its decision once completed. For production traffic, prefer webhooks over polling.
Authentication
The SDK's apiKey option (api_key in Python) is sent as the bearer token, so pass the access token you get by exchanging your key's client id and secret, not the secret itself. Screen and Verify keys are separate, so each service gets its own token. Tokens last 300 seconds: create a client with a fresh token, or request a new one when a call fails with NexielUnauthorizedError. See Authentication.
Quickstart: Nexiel Verify (AML identity)
This is the whole flow. waitForSessionCompletion owns the polling loop, the interval and the timeout, with defaults (poll every 2 seconds, give up after 2 minutes) you can override.
import { NexielVerifyClient } from '@nexiel/sdk';
const verify = new NexielVerifyClient({
baseUrl: 'https://compliance.nexiel.io',
apiKey: process.env.NEXIEL_VERIFY_ACCESS_TOKEN, // from your Verify key, see Authentication
});
const session = await verify.initiateSession({
clientId: 'your-client-id',
checkType: 'aml-identity',
});
// Render session.authorizationRequestUri as a QR code for the user's wallet.
const result = await verify.waitForSessionCompletion(session.sessionId);
if (result.status === 'completed' && result.decision) {
console.log(result.decision.amlResult, result.decision.pepFlag, result.decision.sanctionedFlag);
// The frozen decision artifact a regulator can use to re-derive exactly
// what logic ran, months later.
console.log(result.decision.frozenDecisionArtifact.gatesHash);
}import os
from nexiel_sdk import NexielClient
nexiel = NexielClient(
screen_base_url="https://compliance.nexiel.io",
verify_base_url="https://compliance.nexiel.io",
screen_api_key=os.environ["NEXIEL_SCREEN_ACCESS_TOKEN"],
verify_api_key=os.environ["NEXIEL_VERIFY_ACCESS_TOKEN"],
)
session = nexiel.verify.initiate_session(client_id="your-client-id", check_type="aml-identity")
# Render session.authorization_request_uri as a QR code for the user's wallet.
result = nexiel.verify.wait_for_session_completion(session.session_id)
if str(result.status) == "completed" and result.decision is not None:
print(result.decision.aml_result, result.decision.pep_flag, result.decision.sanctioned_flag)
print(result.decision.frozen_decision_artifact.gates_hash)If the session is still 'pending' or 'awaiting_redirect' once the timeout elapses, both SDKs raise NexielTimeoutError carrying the session id, rather than returning a half-finished result. The session itself may still complete later. Catch this, and either poll again or treat it as abandoned, whichever your product needs.
import { NexielTimeoutError } from '@nexiel/sdk';
try {
await verify.waitForSessionCompletion(session.sessionId, { timeoutMs: 30_000 });
} catch (error) {
if (error instanceof NexielTimeoutError) {
console.log(`Session ${error.sessionId} is taking longer than ${error.timeoutMs}ms. Keep the QR code up.`);
} else {
throw error;
}
}Quickstart: Nexiel Age
Nexiel Age uses the same Verify API, the same waitForSessionCompletion helper and the same session shape. The only difference is checkType. Passing 'age-verification' offers the EU Age Verification attestation's native age_over_18 boolean, or the PID's birthdate claim as a fallback, computed into that same boolean server-side and discarded immediately. No name or nationality is ever requested. See the Age API docs for the full selective-disclosure walkthrough.
const session = await verify.initiateSession({
clientId: 'your-client-id',
checkType: 'age-verification', // the only change from the AML identity example above
});
const result = await verify.waitForSessionCompletion(session.sessionId);
if (result.status === 'completed' && result.decision) {
console.log('age_over_18:', result.decision.booleanProofs['ageOver18']);
// amlResult, pepFlag, sanctionedFlag, and frozenDecisionArtifact are all
// null here: an age-verification check never runs the sanctions/PEP
// matching engine, so there is nothing to screen and nothing to freeze.
}session = nexiel.verify.initiate_session(client_id="your-client-id", check_type="age-verification")
result = nexiel.verify.wait_for_session_completion(session.session_id)
if str(result.status) == "completed" and result.decision is not None:
print("age_over_18:", result.decision.boolean_proofs["ageOver18"])Error handling
Every non-2xx response raises a typed subclass of NexielApiError (NexielBadRequestError, NexielUnauthorizedError, NexielForbiddenError, NexielNotFoundError, NexielConflictError, NexielGoneError, NexielRateLimitError, NexielServerError), carrying the HTTP status, the error code and the parsed response body. See Errors for the codes.
Nexiel Screen from the same SDK
Both SDKs also wrap Nexiel Screen's sanctions and PEP screening. POSSIBLE_MATCH always requires human review. The SDK never auto-clears it, and neither does the API underneath it.
import { NexielClient } from '@nexiel/sdk';
const nexiel = new NexielClient({
screenBaseUrl: 'https://compliance.nexiel.io',
verifyBaseUrl: 'https://compliance.nexiel.io',
screenApiKey: process.env.NEXIEL_SCREEN_ACCESS_TOKEN,
verifyApiKey: process.env.NEXIEL_VERIFY_ACCESS_TOKEN,
});
const result = await nexiel.screen.screenName({ name: 'Jane Doe' });
console.log(result.classification); // 'CLEAR' | 'POSSIBLE_MATCH' | 'CONFIRMED_MATCH'Lists, events and API versions
Version 0.2.0 of both SDKs sends Nexiel-Version: 2026-11-19 with every request, pages through lists for you, and adds Screen decision lists and the Events API:
listAllSessions(list_all_sessionsin Python) iterates every Verify session, fetching the next page as you go. See Pagination.screen.listDecisions(screen.list_decisions) lists Screen decisions, with the same filters asGET /v1/screen/decisions.events.listandevents.retrieveread your organization's recent events. See Events API.
Related tools
@nexiel/verify-widgeton npm: a drop-in Verify widget that runs the same initiate and poll flow in your page.- Agent Toolkit: an MCP server for pointing an AI agent at the same Verify API, for agentic callers rather than your own backend code.
See the Verify API reference and the Screen API reference for every route.