@powercred/liveness-web 0.1.0 → 0.1.1

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
@@ -51,7 +51,12 @@ the `assets` folder, and load the script build. It defines `window.PowerCredLive
51
51
 
52
52
  ## Quick start
53
53
 
54
- ### 1. Start a check from your backend
54
+ ### 1. Create a session on your server
55
+
56
+ This is the only step on your side that isn't in the browser: one call from your own server to the
57
+ PowerCred API, which returns a session for this check. It stays on your server because it uses
58
+ your API key, which must never be put in a web page. The SDK does everything else: the camera,
59
+ the moves, the recording and the upload.
55
60
 
56
61
  ```js
57
62
  // Your server (Node.js shown; any language works)
@@ -141,7 +146,7 @@ new PowerCredLiveness(options)
141
146
  | `flash` | `true` | `false` skips the colour sequence even if the session asks for it |
142
147
  | `assetsUrl` | `assets/` next to the SDK | Where the [assets folder](#hosting-the-assets-folder) is served from |
143
148
  | `timedWindowSeconds` | `3.5` | Seconds per move when the browser shows timed prompts |
144
- | `maxLocalRetries` | `2` | How many times the person may restart after a problem the browser catches (wrong way, face lost, too slow). These restarts don't use up attempts. |
149
+ | `maxLocalRetries` | `2` | How many times the person may restart after a problem the browser catches (wrong way, face lost, too slow). These restarts don't use up attempts. Leaving the page mid-check (another tab or app) also restarts the attempt, but never counts towards this limit. |
145
150
  | `showResult` | `true` | Show the built-in final screen (passed, failed or error). Set `false` to show your own when `start()` resolves. The prompts, and "Try again" between attempts, still appear. |
146
151
  | `strings` | English | Replace any on-screen text. See [Customising](#customising-the-look-and-text). |
147
152
  | `theme` | | `{ primaryColor, fontFamily }` |
@@ -213,7 +218,7 @@ check.
213
218
  | `{ type: 'recording_started' }` | Recording began |
214
219
  | `{ type: 'challenge_started', challenge }` | A move was asked for |
215
220
  | `{ type: 'challenge_passed', challenge }` | The browser saw the move |
216
- | `{ type: 'attempt_aborted', reason }` | The browser stopped the attempt: `wrong_direction`, `face_lost`, `multiple_faces`, `too_slow` or `challenge_timeout:<move>`. The person is offered a restart. |
221
+ | `{ type: 'attempt_aborted', reason }` | The browser stopped the attempt: `wrong_direction`, `face_lost`, `multiple_faces`, `too_slow`, `challenge_timeout:<move>`, or `interrupted` (the person switched to another tab or app mid-check). Nothing is uploaded, and the person is offered a restart. |
217
222
  | `{ type: 'flash_started' }`, `{ type: 'flash_ended' }` | The colour sequence |
218
223
  | `{ type: 'uploading', bytes }` | The recording is being sent |
219
224
  | `{ type: 'server_result', result }` | PowerCred's verdict for an attempt |