Skip to content

Commit c8c7a9a

Browse files
committed
* added explanation about polling
1 parent 887c14b commit c8c7a9a

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

vite-web-sdk/README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
# Vite Web SDK example
2-
This examples runs the basic create session -> frontId -> backID -> processId -> Selfie -> faceMatch -> getFinishStatus flow, the code is simple enough to insert or remove any step
3-
for testing or creating proof of concepts.
2+
This examples runs the basic create session -> renderRedirectToMobile -> userConsent -> frontId -> backID ->
3+
processId -> Selfie -> faceMatch -> getFinishStatus flow, the code is simple enough to insert or remove any
4+
step for testing or creating proof of concepts.
5+
6+
The code is made with renderRedirectToMobile as first step, if it detects that the user is in desktop it will
7+
present renderRedirectToMobile with an `URL` that points to this same file using the `VITE_LOCAL_SERVER_URL`
8+
enviroment variable + a generated `uuid` that we received from the call to `/start`.
9+
10+
The `renderRedirectToMobile` has a behaviour where it automatically polls for the status of the session, and
11+
when it detects that the session has finished, it executes the `onSuccess` method to continue.
12+
13+
The URL when opened in mobile will read the `uuid` from the query params, and send it to `/start` to continue
14+
the session instead of creating a new one.
15+
16+
The `uuid` links both desktop and mobile that are running in parallel to give the best possible experience to
17+
the user.
418

519
# Requirements
620
Vite requires Node.js version 14.18+, 16+. some templates require a higher Node.js version to work, please upgrade if your package manager warns about it.

0 commit comments

Comments
 (0)