@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 +14 -11
- package/dist/didit-sdk.cjs +379 -73
- package/dist/didit-sdk.cjs.js +379 -73
- package/dist/didit-sdk.cjs.js.map +1 -1
- package/dist/didit-sdk.cjs.map +1 -1
- package/dist/didit-sdk.esm.js +857 -297
- package/dist/didit-sdk.esm.js.map +1 -1
- package/dist/didit-sdk.module.js +380 -74
- package/dist/didit-sdk.module.js.map +1 -1
- package/dist/didit-sdk.umd.js +858 -296
- package/dist/didit-sdk.umd.js.map +1 -1
- package/dist/didit-sdk.umd.min.js +2 -2
- package/dist/didit-sdk.umd.min.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -257,27 +257,23 @@ DiditSdk.shared.startVerification({
|
|
|
257
257
|
|
|
258
258
|
## Modal Sizing
|
|
259
259
|
|
|
260
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
266
|
+
### Redesigned verification flow
|
|
267
267
|
|
|
268
|
-
|
|
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.
|
|
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
|
|
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
|