smartcomply-web-sdk 1.0.18 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,7 +39,8 @@ var SmartComplySDK = (() => {
39
39
  // src/client/Config.ts
40
40
  var BASE_URLS = {
41
41
  sandbox: "https://dev-adhere.smartcomply.com",
42
- production: "https://adhere-api.smartcomply.com"
42
+ production: "https://adhere-api.smartcomply.com",
43
+ local: "http://127.0.0.1:8000"
43
44
  };
44
45
 
45
46
  // src/errors/SDKError.ts
@@ -4526,12 +4527,12 @@ var SmartComplySDK = (() => {
4526
4527
  TURN_LEFT: `
4527
4528
  <div style="display:flex;flex-direction:column;align-items:center;gap:10px;">
4528
4529
  <div style="font-size:56px;line-height:1;animation:sc-slide-left 1s ease-in-out infinite;">\u2B05\uFE0F</div>
4529
- <div style="font-size:13px;font-weight:600;color:#fff;opacity:0.9;letter-spacing:0.5px;">TURN HEAD LEFT</div>
4530
+ <div style="font-size:13px;font-weight:600;color:#fff;opacity:0.9;letter-spacing:0.5px;">TURN HEAD RIGHT</div>
4530
4531
  </div>`,
4531
4532
  TURN_RIGHT: `
4532
4533
  <div style="display:flex;flex-direction:column;align-items:center;gap:10px;">
4533
4534
  <div style="font-size:56px;line-height:1;animation:sc-slide-right 1s ease-in-out infinite;">\u27A1\uFE0F</div>
4534
- <div style="font-size:13px;font-weight:600;color:#fff;opacity:0.9;letter-spacing:0.5px;">TURN HEAD RIGHT</div>
4535
+ <div style="font-size:13px;font-weight:600;color:#fff;opacity:0.9;letter-spacing:0.5px;">TURN HEAD LEFT</div>
4535
4536
  </div>`,
4536
4537
  TURN_HEAD: `
4537
4538
  <div style="display:flex;flex-direction:column;align-items:center;gap:10px;">
@@ -5074,8 +5075,10 @@ var SmartComplySDK = (() => {
5074
5075
  describeAction(action) {
5075
5076
  const labels = {
5076
5077
  BLINK: "Blink your eyes",
5077
- TURN_LEFT: "Turn your head left",
5078
- TURN_RIGHT: "Turn your head right",
5078
+ TURN_LEFT: "Turn your head right",
5079
+ // camera-left = user's right (mirror)
5080
+ TURN_RIGHT: "Turn your head left",
5081
+ // camera-right = user's left (mirror)
5079
5082
  TURN_HEAD: "Turn your head side to side",
5080
5083
  OPEN_MOUTH: "Open your mouth wide"
5081
5084
  };
@@ -5300,7 +5303,10 @@ var SmartComplySDK = (() => {
5300
5303
  const uiChallenge = {
5301
5304
  actions: entry.challenge_actions,
5302
5305
  time_limit_seconds: 45,
5303
- instruction: "Complete each action below to verify it's you"
5306
+ instruction: "Complete each action below to verify it's you",
5307
+ // Use backend-provided instructions if available (mirror-corrected),
5308
+ // otherwise fall back to the frontend labels.
5309
+ instructions: entry.challenge_instructions
5304
5310
  };
5305
5311
  ui2.unmount();
5306
5312
  const videoEl = ui2.mount(container, uiChallenge);
@@ -5331,7 +5337,8 @@ var SmartComplySDK = (() => {
5331
5337
  } else if (current) {
5332
5338
  if (current !== lastAction) {
5333
5339
  lastAction = current;
5334
- ui2.updateInstruction(this.describeAction(current));
5340
+ const label = uiChallenge.instructions?.[current] || this.describeAction(current);
5341
+ ui2.updateInstruction(label);
5335
5342
  }
5336
5343
  } else {
5337
5344
  ui2.updateInstruction("All actions completed! \u2713");
@@ -5374,7 +5381,7 @@ var SmartComplySDK = (() => {
5374
5381
  videoBlob.size
5375
5382
  );
5376
5383
  await ui2.showResult(
5377
- submitResult.status === "processing" ? "processing" : "failed",
5384
+ submitResult.status === "failed" ? "failed" : "processing",
5378
5385
  submitResult.id
5379
5386
  );
5380
5387
  return submitResult;
@@ -5445,8 +5452,10 @@ var SmartComplySDK = (() => {
5445
5452
  describeAction(action) {
5446
5453
  const descriptions = {
5447
5454
  BLINK: "Blink your eyes",
5448
- TURN_LEFT: "Turn your head left",
5449
- TURN_RIGHT: "Turn your head right",
5455
+ TURN_LEFT: "Turn your head right",
5456
+ // camera-left = user's right (mirror)
5457
+ TURN_RIGHT: "Turn your head left",
5458
+ // camera-right = user's left (mirror)
5450
5459
  TURN_HEAD: "Turn your head side to side",
5451
5460
  OPEN_MOUTH: "Open your mouth wide"
5452
5461
  };
@@ -7577,7 +7586,8 @@ var SmartComplySDK = (() => {
7577
7586
  }
7578
7587
  if (result.status === "failed" || result.status === "expired_document") {
7579
7588
  onResolved(result.status);
7580
- applyFailed(result.failure_reason);
7589
+ const reason = result.failure_reason || (result.status === "expired_document" ? "Your document has expired. Please use a valid ID." : "Verification could not be completed. Please try again.");
7590
+ applyFailed(reason);
7581
7591
  return;
7582
7592
  }
7583
7593
  if (polls < MAX_POLLS && !this.isDestroyed) {