Auvral

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.

OptionTypeDefaultDescription
urlstringrequiredThe url returned by POST /v1/sessions. Missing or unparseable, nothing mounts and onError({ code: "missing_url" }) fires.
onResultfunctionnoneCalled once, when there is a verdict. Does not mean the overlay closed.
onClosefunctionnoneCalled once, when the overlay unmounts.
onErrorfunctionnoneIntegration errors only, never verification outcomes. See Errors.
dismissiblebooleantrueWhether 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 })

FieldTypeDescription
status"verified" | "rejected"The verdict, as reported by the browser.
verificationIdstringThe verification's id.
sessionIdstringThe 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 })

reasonMeaning
"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

MemberTypeDescription
close()functionUnmounts the overlay and fires onClose({ reason: "programmatic" }). Calling it again does nothing.
isOpenbooleantrue while the overlay is mounted.

After close(), the DOM is exactly as it was before init().

Errors

codeCauseFix
missing_urlinit() called with no url, or a value that is not a valid URLCheck that your session endpoint returned data.url and that you passed it through
already_openinit() called while an overlay is openReuse the returned handle, or close() first

Statics

MemberTypeDescription
AuvralVerification.versionstringThe 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.

On this page