SDK reference
Every option, callback, handle property and error code in the Auvral web SDK.
The bundle defines a single global, window.AuvralVerification. No module system, no
imports, no dependencies.
const auvral = new AuvralVerification();
const frame = auvral.init({ /* options */ });init(options)
Mounts the verification overlay and returns a handle.
| Option | Type | Default | Description |
|---|---|---|---|
url | string | required | The url returned by POST /v1/sessions. Missing or unparseable, nothing mounts and onError({ code: "missing_url" }) fires. |
onResult | function | none | Called once, when there is a verdict. Does not mean the overlay closed. |
onClose | function | none | Called once, when the overlay unmounts. |
onError | function | none | Integration errors only, never verification outcomes. See Errors. |
dismissible | boolean | true | Whether the SDK draws its own close button over the overlay. |
init() never stacks overlays. Calling it while one is open logs a console.warn, fires
onError({ code: "already_open" }), and returns the handle to the overlay already there.
onResult({ status, verificationId, sessionId })
| Field | Type | Description |
|---|---|---|
status | "verified" | "rejected" | The verdict, as reported by the browser. |
verificationId | string | The verification's id. |
sessionId | string | The session id you received from POST /v1/sessions. |
"rejected" is a normal outcome, not an error.
Requires allowedOrigins on the session, see
Web SDK.
The postMessage is a UI signal, not a proof
Never unlock an account, approve a payment or change business state from it. The truth is
the webhook or a server-side GET. It lives in the browser and the user controls their
browser.
onClose({ reason })
reason | Meaning |
|---|---|
"completed" | Your user pressed the final button on the result screen. |
"user_dismissed" | Your user closed the overlay. |
"programmatic" | Your code called frame.close(). |
A close without a preceding onResult means your user left early. The session stays
usable until it expires, so reopening the same url resumes where they stopped.
onError({ code, message })
Integration errors: problems with how the SDK was called, never problems with the
verification. With no onError handler the SDK writes the same detail with
console.error. The SDK never throws into your code.
The handle
| Member | Type | Description |
|---|---|---|
close() | function | Unmounts the overlay and fires onClose({ reason: "programmatic" }). Calling it again does nothing. |
isOpen | boolean | true while the overlay is mounted. |
After close(), the DOM is exactly as it was before init().
Errors
code | Cause | Fix |
|---|---|---|
missing_url | init() called with no url, or a value that is not a valid URL | Check that your session endpoint returned data.url and that you passed it through |
already_open | init() called while an overlay is open | Reuse the returned handle, or close() first |
Statics
| Member | Type | Description |
|---|---|---|
AuvralVerification.version | string | The version of the loaded bundle. Worth reporting when something misbehaves. |
What the SDK touches
- The DOM: one element, covering the viewport, isolated from your styles.
- Nothing else. No cookies, no
localStorage, no history entries.
Browser support
Every current browser. No polyfills.