@didit-protocol/sdk-web 0.5.1 → 0.6.0

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
@@ -257,27 +257,23 @@ DiditSdk.shared.startVerification({
257
257
 
258
258
  ## Modal Sizing
259
259
 
260
- Modal mode uses a maximum width of 500px and a maximum height of 700px. On shorter desktop and landscape viewports, the iframe tracks 90% of the visible viewport so the modal never extends beyond its container. The hosted flow owns the scrollbar inside the iframe, keeping later steps reachable without scrolling the page behind the modal.
260
+ Verification steps are phone-shaped: 440px wide and 860px tall, or the height of the window less a 16px margin above and below when the window is shorter, so every step fits as it does on a phone.
261
261
 
262
- Browsers that support dynamic viewport units use `dvh`, while older supported browsers fall back to `vh`. At widths of 540px and below, the modal fills the visible viewport. The close button and exit confirmation stay inside the modal at every size.
262
+ On a computer the handoff screen (the QR code to continue on a phone) is a wider two-panel card: 960px by 660px on a window of 1000px or more, never wider than the window less its margin and never taller than 90% of it. In a narrower window the card stacks and its height follows its content. The modal stays hidden behind a spinner until the page says which of the two it shows, and then appears at that size, so it never opens small and grows. It changes size once, with a short animation, only when the page moves from one to the other (for example when the person continues on the computer). A page that does not say gets the phone-shaped size after 3 seconds.
263
263
 
264
- ### Redesigned verification flow
264
+ Browsers that support dynamic viewport units use `dvh`, while older supported browsers fall back to `vh`. At widths of 540px and below, the modal fills the visible viewport.
265
265
 
266
- When the hosted verification page reports its layout with a `didit:layout` message, the modal sizes itself around it:
266
+ ### Redesigned verification flow
267
267
 
268
- | Window width | Modal |
269
- |---|---|
270
- | 1024px and wider | The handoff card: 960px by 660px in every state, at most 90% of the window's width and height |
271
- | 541px to 1023px | 500px wide, as tall as the page's content, at most 90% of the window's height |
272
- | 540px and below | Full screen, as above |
268
+ When the hosted verification page reports its layout with a `didit:layout` message, the modal takes the page's light or dark theme and its text direction. Its `kind` field (`handoff` or `step`, `step` when missing) sets the modal's size as described above.
273
269
 
274
- The close button becomes a 44px circle over the page's top bar. It follows the page's light or dark theme and moves to the left for right-to-left languages. If a large text size makes the exit confirmation taller than a short page, the confirmation scrolls inside the modal. Until the page reports its layout, and for pages that never do, the modal keeps the 500px by 700px size above. Embedded mode keeps filling its host element. There is nothing to configure, and every existing option keeps working.
270
+ The close button becomes a 44px circle over the page's top bar. It follows the page's light or dark theme and moves to the left for right-to-left languages. If a large text size makes the exit confirmation taller than a short page, the confirmation scrolls inside the modal. Pages that never report a layout get the phone-shaped size. Embedded mode keeps filling its host element. There is nothing to configure, and every existing option keeps working.
275
271
 
276
272
  The SDK tells the page how it is shown with two query parameters on the verification URL: `sdk_presentation` (`modal` or `embedded`) and, in a modal, `sdk_close_button` (`true` or `false`, following `showCloseButton`). The SDK handles the `didit:layout` message itself and does not pass it to `onEvent`.
277
273
 
278
274
  ## Embedded Mode
279
275
 
280
- Render verification inline instead of a modal overlay. Embedded mode does not apply the modal's 500px by 700px cap; the SDK fills the host element's content box. Give the host an explicit or otherwise resolved height:
276
+ Render verification inline instead of a modal overlay. Embedded mode does not apply the modal's size; the SDK fills the host element's content box. Give the host an explicit or otherwise resolved height:
281
277
 
282
278
  ```html
283
279
  <div id="verification-container" style="width: 500px; height: 700px;"></div>
@@ -486,6 +482,13 @@ Delivery is best effort: the queue is in memory, and browsers can terminate pend
486
482
 
487
483
  Full guide: [SDK Event Submission](https://docs.didit.me/transaction-monitoring/sdk-event-submission).
488
484
 
485
+ ### One device across your site and the verification
486
+
487
+ A browser keeps the storage of the verification's frame apart from your page's, so the two would never share a device id.
488
+ When your page already keeps one for Didit (it has sent events, transactions or sign-ins), `startVerification` passes it to the verification as the `sdk_device_id` query parameter.
489
+ The verification then reports it next to its own signals, and goes by it where the browser gives the frame no storage that lasts.
490
+ A page that keeps no id gets none created: opening a verification adds no cookie and no storage entry to your site.
491
+
489
492
  ## API Reference
490
493
 
491
494
  ### DiditSdk.shared