Skip to content

Commit 5e440d7

Browse files
committed
* uuid -> uniqueId
* removed interviewId from response * updated docs
1 parent e40e682 commit 5e440d7

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed

vite-web-sdk/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
VITE_TOKEN_SERVER_URL=/api
22
VITE_LOCAL_SERVER_URL=https://your-ip:port/
33
VITE_API_URL=https://demo-api.incodesmile.com/0
4-
VITE_SDK_URL=https://sdk.incode.com/sdk/onBoarding-1.69.1.js
4+
VITE_SDK_URL=https://sdk.incode.com/sdk/onBoarding-1.70.0.js

vite-web-sdk/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ step for testing or creating proof of concepts.
55

66
The code is made with renderRedirectToMobile as first step, if it detects that the user is in desktop it will
77
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`.
8+
enviroment variable + a generated `uniqueId` that we received from the call to `/start`.
99

1010
The `renderRedirectToMobile` has a behaviour where it automatically polls for the status of the session, and
1111
when it detects that the session has finished, it executes the `onSuccess` method to continue.
1212

13-
The URL when opened in mobile will read the `uuid` from the query params, and send it to `/start` to continue
13+
The URL when opened in mobile will read the `uniqueId` from the query params, and send it to `/start` to continue
1414
the session instead of creating a new one.
1515

16-
The `uuid` links both desktop and mobile that are running in parallel to give the best possible experience to
16+
The `uniqueId` links both desktop and mobile that are running in parallel to give the best possible experience to
1717
the user.
1818

1919
This diagram explains it in detail:
@@ -28,13 +28,13 @@ sequenceDiagram
2828
f -->> b: /start
2929
b -->> a: /omni/start
3030
a -->> b: {token, interviewId}
31-
note over b: Generate uuid
32-
note over b: Save Session<br>{token, interviewId, uuid}
33-
b-->> f: {token, interviewId, uuid}
34-
else uuid comes in query params
35-
f -->> b: /start?uuid=<uuid>
36-
note over b: Retrieve stored Session<br>{token, interviewId, uuid}
37-
b-->> f: {token, interviewId, uuid}
31+
note over b: Generate uniqueId
32+
note over b: Save Session<br>{token, interviewId, uniqueId}
33+
b-->> f: {token, uniqueId}
34+
else uniqueId comes in query params
35+
f -->> b: /start?uniqueId=<uniqueId>
36+
note over b: Retrieve stored Session<br>{token, interviewId, uniqueId}
37+
b-->> f: {token, uniqueId}
3838
end
3939
4040
alt Desktop
@@ -68,7 +68,7 @@ Copy `.env.example` to `.env.local` and add your local values
6868
VITE_TOKEN_SERVER_URL=/api
6969
VITE_LOCAL_SERVER_URL=https://your-ip:port/
7070
VITE_API_URL=https://demo-api.incodesmile.com/0
71-
VITE_SDK_URL=https://sdk.incode.com/sdk/onBoarding-1.69.0.js
71+
VITE_SDK_URL=https://sdk.incode.com/sdk/onBoarding-1.70.0.js
7272
```
7373
Remember the Flow holds the backend counter part of the process, some configurations there might affect the behavior of the WebSDK here.
7474

vite-web-sdk/main.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ const container = document.getElementById("camera-container");
99

1010
async function startOnboardingSession() {
1111
const urlParams = new URLSearchParams(window.location.search);
12-
const uuid = urlParams.get('uuid');
12+
const uniqueId = urlParams.get('uniqueId');
1313

1414
let sessionStartUrl = `${tokenServerURL}/start`
15-
if (uuid) sessionStartUrl +=`?uuid=${uuid}`;
15+
if (uniqueId) sessionStartUrl +=`?uniqueId=${uniqueId}`;
1616

1717
const response = await fetch(sessionStartUrl);
1818
if (!response.ok) {
@@ -35,7 +35,7 @@ function renderRedirectToMobile(){
3535
finish();
3636
},
3737
session: session,
38-
url: `${localServerUrl}?uuid=${session.uuid}`,
38+
url: `${localServerUrl}?uniqueId=${session.uniqueId}`,
3939
// showSms: false, //uncomment if you want to remove the SMS feature
4040
});
4141
} else {
@@ -120,10 +120,6 @@ async function app() {
120120
apiURL: apiURL
121121
});
122122

123-
// Incode web_sdk need to preload some core component before being usable
124-
container.innerHTML = "<h1>Warming up...</h1>";
125-
await incode.warmup();
126-
127123
// Create the single session
128124
container.innerHTML = "<h1>Creating session...</h1>";
129125
try {

0 commit comments

Comments
 (0)