smartcomply-web-sdk 1.0.74 → 1.0.76

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.
package/README.md CHANGED
@@ -59,22 +59,10 @@ Exactly which ID types are available depends on what's enabled for your account
59
59
 
60
60
  ## Install
61
61
 
62
- ```bash
63
- npm install smartcomply-web-sdk
64
- ```
65
-
66
- > `npm install` resolves to the latest version **at the moment you run it**, then locks that exact version in `package-lock.json` — it will not silently update itself afterward. To pick up new fixes/releases later, run `npm update smartcomply-web-sdk` (respects your `package.json` version range) or `npm install smartcomply-web-sdk@latest` (jumps to the newest release regardless of range). Check [npmjs.com/package/smartcomply-web-sdk](https://www.npmjs.com/package/smartcomply-web-sdk) for the current version number.
67
-
68
- ### Alternative: CDN (No Build Step)
62
+ ### Recommended: CDN with `@1` (set once, stays current automatically)
69
63
 
70
64
  ```html
71
- <!-- Always latest version -->
72
- <script src="https://cdn.jsdelivr.net/npm/smartcomply-web-sdk@latest/dist/smartcomply.browser.js"></script>
73
-
74
- <!-- Or pin to a specific version (recommended for production) — replace X.Y.Z
75
- with the version you've actually tested against. Current version:
76
- https://www.npmjs.com/package/smartcomply-web-sdk -->
77
- <script src="https://cdn.jsdelivr.net/npm/smartcomply-web-sdk@X.Y.Z/dist/smartcomply.browser.js"></script>
65
+ <script src="https://cdn.jsdelivr.net/npm/smartcomply-web-sdk@1/dist/smartcomply.browser.js"></script>
78
66
 
79
67
  <script>
80
68
  // SDK available as window.SmartComplySDK
@@ -86,7 +74,29 @@ npm install smartcomply-web-sdk
86
74
  </script>
87
75
  ```
88
76
 
89
- > Unlike `npm install`, CDN `@latest` re-resolves on **every page load** you automatically get new releases the moment they're published, with no update step on your end. That's convenient for prototyping, but it also means a breaking change ships to your live site with zero warning. Pin to a specific version in production instead, and update the pin deliberately when you're ready. See [npmjs.com/package/smartcomply-web-sdk](https://www.npmjs.com/package/smartcomply-web-sdk) for the current version number.
77
+ `@1` always resolves to the latest `1.x.x` release bug fixes and new features reach your site automatically the moment we publish them, with **no code change on your end, ever**. We commit to never shipping a breaking change as a `1.x` release; if a breaking change is ever needed, it ships as `2.0.0` and `@1` will keep serving the last safe `1.x` release until you deliberately opt in. This is the same versioning model used by most public JS SDKs (Stripe.js, Google Maps, etc.).
78
+
79
+ Other CDN options:
80
+
81
+ ```html
82
+ <!-- Always the newest release, including any future major version — for
83
+ prototyping, or if you specifically want every change instantly -->
84
+ <script src="https://cdn.jsdelivr.net/npm/smartcomply-web-sdk@latest/dist/smartcomply.browser.js"></script>
85
+
86
+ <!-- Pin to one exact version — only if you need manual control over
87
+ updates. Replace X.Y.Z with the version you've tested against. -->
88
+ <script src="https://cdn.jsdelivr.net/npm/smartcomply-web-sdk@X.Y.Z/dist/smartcomply.browser.js"></script>
89
+ ```
90
+
91
+ > `@1`/`@latest` re-resolve on **every page load** — that's what makes them self-updating, with no rebuild or redeploy needed on your side. An exact `@X.Y.Z` pin never moves until you manually change the number in your script tag. See [npmjs.com/package/smartcomply-web-sdk](https://www.npmjs.com/package/smartcomply-web-sdk) for release history.
92
+
93
+ ### Alternative: npm
94
+
95
+ ```bash
96
+ npm install smartcomply-web-sdk
97
+ ```
98
+
99
+ > Unlike the CDN, npm has no auto-updating option — this is true for every npm package, not specific to ours. `npm install` resolves to the latest version **at the moment you run it**, then locks that exact version in `package-lock.json`; it will not change again on its own. Run `npm update smartcomply-web-sdk` periodically (or before each deploy) to pick up new fixes — this stays within the `^1.0.x` range already set in your `package.json`, and we commit to never shipping a breaking change within `1.x`, so it's always safe to run. Check [npmjs.com/package/smartcomply-web-sdk](https://www.npmjs.com/package/smartcomply-web-sdk) for the current version number.
90
100
 
91
101
  ---
92
102
 
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BASE_URLS = void 0;
4
4
  exports.BASE_URLS = {
5
- sandbox: "https://dev-adhere.smartcomply.com",
5
+ sandbox: "https://adhere-staging-api.smartcomply.com",
6
6
  production: "https://adhere-api.smartcomply.com",
7
7
  local: "http://127.0.0.1:8000",
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/client/Config.ts"],"names":[],"mappings":";;;AAEa,QAAA,SAAS,GAAgC;IACpD,OAAO,EAAE,oCAAoC;IAC7C,UAAU,EAAE,oCAAoC;IAChD,KAAK,EAAE,uBAAuB;CAC/B,CAAC"}
1
+ {"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/client/Config.ts"],"names":[],"mappings":";;;AAEa,QAAA,SAAS,GAAgC;IACpD,OAAO,EAAE,4CAA4C;IACrD,UAAU,EAAE,oCAAoC;IAChD,KAAK,EAAE,uBAAuB;CAC/B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  export const BASE_URLS = {
2
- sandbox: "https://dev-adhere.smartcomply.com",
2
+ sandbox: "https://adhere-staging-api.smartcomply.com",
3
3
  production: "https://adhere-api.smartcomply.com",
4
4
  local: "http://127.0.0.1:8000",
5
5
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Config.js","sourceRoot":"","sources":["../../../src/client/Config.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAgC;IACpD,OAAO,EAAE,oCAAoC;IAC7C,UAAU,EAAE,oCAAoC;IAChD,KAAK,EAAE,uBAAuB;CAC/B,CAAC"}
1
+ {"version":3,"file":"Config.js","sourceRoot":"","sources":["../../../src/client/Config.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAgC;IACpD,OAAO,EAAE,4CAA4C;IACrD,UAAU,EAAE,oCAAoC;IAChD,KAAK,EAAE,uBAAuB;CAC/B,CAAC"}
@@ -66,6 +66,7 @@ export declare class SmartComplyFlow {
66
66
  private _ocrPollTimer;
67
67
  private _uiTimeoutId;
68
68
  private sessionExpiryTimer;
69
+ private sessionExpiredTimer;
69
70
  private _pollStatusTimer;
70
71
  private docCapture;
71
72
  private constructor();
@@ -90,6 +91,9 @@ export declare class SmartComplyFlow {
90
91
  private mount;
91
92
  private initialize;
92
93
  private _showExpiryWarningWhenSafe;
94
+ private static readonly MAX_EXPIRY_DEFERRALS;
95
+ private _expiryDeferrals;
96
+ private _enforceSessionExpiry;
93
97
  private showStep;
94
98
  private renderStep;
95
99
  private renderLoading;
@@ -1 +1 @@
1
- {"version":3,"file":"SmartComplyFlow.d.ts","sourceRoot":"","sources":["../../../src/flow/SmartComplyFlow.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAIxF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAwC/C,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IAC1C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,kBAAkB,CAAC,EAAE,sBAAsB,CAAC;CAC7C;AAsRD,qBAAa,eAAe;IAC1B,OAAO,CAAC,GAAG,CAAc;IACzB,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,KAAK,CAAoC;IAGjD,OAAO,CAAC,OAAO,CAA+B;IAC9C,OAAO,CAAC,KAAK,CAA+B;IAC5C,OAAO,CAAC,WAAW,CAA+B;IAClD,OAAO,CAAC,WAAW,CAA+B;IAClD,OAAO,CAAC,SAAS,CAA+B;I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AAmB;IAsB3B,OAAO,CAAC,qBAAqB;IAmB7B,sGAAsG;IACtG,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,cAAc;IAgBtB;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,cAAc;IA0EtB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,YAAY;CAiCrB"}
@@ -328,10 +328,12 @@ export class SmartComplyFlow {
328
328
  this._uiTimeoutId = null;
329
329
  // Session expiry
330
330
  this.sessionExpiryTimer = null;
331
+ this.sessionExpiredTimer = null;
331
332
  // Status polling (result screen)
332
333
  this._pollStatusTimer = null;
333
334
  // Components
334
335
  this.docCapture = null;
336
+ this._expiryDeferrals = 0;
335
337
  this.options = options;
336
338
  this.sdk = new SmartComply({
337
339
  apiKey: options.apiKey,
@@ -398,6 +400,10 @@ export class SmartComplyFlow {
398
400
  clearTimeout(this.sessionExpiryTimer);
399
401
  this.sessionExpiryTimer = null;
400
402
  }
403
+ if (this.sessionExpiredTimer) {
404
+ clearTimeout(this.sessionExpiredTimer);
405
+ this.sessionExpiredTimer = null;
406
+ }
401
407
  if (this._pollStatusTimer) {
402
408
  clearTimeout(this._pollStatusTimer);
403
409
  this._pollStatusTimer = null;
@@ -588,6 +594,15 @@ export class SmartComplyFlow {
588
594
  const expiresMs = new Date(expiresAt).getTime() - Date.now();
589
595
  const warnMs = Math.max(expiresMs - 120000, 0); // warn 2 min before
590
596
  this.sessionExpiryTimer = setTimeout(() => this._showExpiryWarningWhenSafe(), warnMs);
597
+ // The warning above is advisory only and can defer indefinitely
598
+ // while the user sits on a camera-active step — without a hard
599
+ // stop, an ignored/deferred warning left the widget open against
600
+ // an already-expired backend session (SessionToken.expires_at,
601
+ // 30 min — see sdk/views.py's SessionToken.objects.create call)
602
+ // for as long as the host page stayed open. Force-close once the
603
+ // real deadline passes so the widget's lifetime never exceeds
604
+ // what the backend actually honors.
605
+ this.sessionExpiredTimer = setTimeout(() => this._enforceSessionExpiry(), Math.max(expiresMs, 0));
591
606
  }
592
607
  // Load config
593
608
  this.sdkConfig = await this.sdk.initializeConfig();
@@ -621,6 +636,19 @@ export class SmartComplyFlow {
621
636
  }
622
637
  this.showErrorStep("Your session is about to expire. Please complete verification quickly or restart.");
623
638
  }
639
+ _enforceSessionExpiry() {
640
+ if (this.isDestroyed)
641
+ return;
642
+ const cameraActiveSteps = ["document_capture", "liveness"];
643
+ if (cameraActiveSteps.includes(this.currentStep) &&
644
+ this._expiryDeferrals < SmartComplyFlow.MAX_EXPIRY_DEFERRALS) {
645
+ this._expiryDeferrals += 1;
646
+ this.sessionExpiredTimer = setTimeout(() => this._enforceSessionExpiry(), 5000);
647
+ return;
648
+ }
649
+ this.showErrorStep("Your session has expired. Please restart verification.");
650
+ this.close();
651
+ }
624
652
  // ─────────────────────────────────────────────────────────────────
625
653
  // Step rendering
626
654
  // ─────────────────────────────────────────────────────────────────
@@ -2521,4 +2549,11 @@ export class SmartComplyFlow {
2521
2549
  }
2522
2550
  }
2523
2551
  SmartComplyFlow.MAX_RETRIES = 3;
2552
+ // Hard stop once the backend session (SessionToken.expires_at, 30 min)
2553
+ // has actually passed. Deferred the same way as the warning above while
2554
+ // a camera is live so we don't tear down an in-progress scan, but capped
2555
+ // — the earlier warning already gave the user 2 minutes' notice, so
2556
+ // there's no reason to keep deferring past a short grace window the way
2557
+ // the advisory warning does.
2558
+ SmartComplyFlow.MAX_EXPIRY_DEFERRALS = 12; // 12 * 5s = 60s grace
2524
2559
  //# sourceMappingURL=SmartComplyFlow.js.map