Introducing VIDA Identity Stack: All of VIDA, in one place 🎉
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Asset Preloading

The preload() method prepares the SDK in the background so it is ready before your user starts a liveness or identity verification flow.

Availability: preload() is available from SDK v1.1.3 onwards. Make sure your integration uses v1.1.3 or later before calling it.

Overview

When the SDK starts a verification flow, it needs to download several assets (see What gets prefetched). If these are downloaded only when the flow begins, the user may see a short loading delay.

preload() fetches these assets ahead of time and stores them in the browser cache. When the user later reaches the verification screen and your app calls init(), the assets are already available, so the flow starts faster.

When To Use

Call preload() on any page your user visits before the verification screen - for example a landing page, a consent screen, or a KYC introduction page.

By the time the user reaches the verification flow, the required assets will already be cached in the browser.

preload() is a new, optional method. It does not change your existing integration - init(), destroy(), and all other SDK methods work exactly as before. You can adopt preload() on its own, at any time.

Method Reference

Property
Value

Parameters

None

Returns

void

Auth required

No - can be called without a token or signing key

Usage

CDN

Replace <VERSION> with the SDK version you are using (v1.1.3 or later).

NPM

What Gets Prefetched

Asset
Description

WASM binary

Vision runtime. The correct variant for the user's device is selected automatically.

JS glue file

JavaScript loader that starts the WASM binary.

Face detection model

Machine learning model used for face detection and landmark extraction.

Behaviour Notes

  • Optional. If you do not call preload(), the SDK downloads its assets on demand when the verification flow starts. Everything still works — the flow may just take slightly longer to appear.

  • Safe to call multiple times. Calling preload() more than once does not create duplicate downloads.

  • Non-blocking. Assets are fetched using <link rel="prefetch">, which loads at low priority and does not slow down or block your page.

Last updated