@soliton-id/web-sdk 1.1.1 → 1.1.2
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/CHANGELOG.md +8 -0
- package/README.md +78 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ All notable changes to `@soliton-id/web-sdk`. The `soliton-v1` postMessage
|
|
|
4
4
|
protocol is frozen: changes are additive only, so older SDK versions keep
|
|
5
5
|
working against the hosted flow.
|
|
6
6
|
|
|
7
|
+
## 1.1.2 — 2026-10-29
|
|
8
|
+
|
|
9
|
+
Documentation only; no code or API changes. The README explains `intro=skip`,
|
|
10
|
+
which opens the hosted flow straight into the camera, and what an integration
|
|
11
|
+
must then do: explain the check and collect consent, ask Medium and High users
|
|
12
|
+
to raise their volume, allow camera, microphone and autoplay on every iframe,
|
|
13
|
+
and configure iOS and Android WebViews.
|
|
14
|
+
|
|
7
15
|
## 1.1.1 — 2026-10-29
|
|
8
16
|
|
|
9
17
|
Package metadata only; no code or API changes. The repository and issue links
|
package/README.md
CHANGED
|
@@ -187,6 +187,84 @@ On completion, require the authenticated status response's `liveness_tier`
|
|
|
187
187
|
and `environment` to match the values stored for your user before accepting
|
|
188
188
|
the verdict. The callback still carries only `verificationId`.
|
|
189
189
|
|
|
190
|
+
## Skipping the instructions screen
|
|
191
|
+
|
|
192
|
+
By default the hosted page opens on Soliton's instructions screen and the user
|
|
193
|
+
taps Begin. To open straight into the camera instead, add `intro=skip` to the
|
|
194
|
+
hosted URL, embedded or as a top-level redirect:
|
|
195
|
+
|
|
196
|
+
```ts
|
|
197
|
+
const directUrl = new URL(url);
|
|
198
|
+
directUrl.searchParams.set("intro", "skip");
|
|
199
|
+
const handle = open({ url: directUrl.toString(), onComplete });
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
If you skip the instructions screen, you must:
|
|
203
|
+
|
|
204
|
+
1. **Explain the check and collect consent first.** Tell the user what happens
|
|
205
|
+
(camera, plus microphone for Medium and High) and collect any consent you
|
|
206
|
+
need before opening the flow. For Medium and High, ask users to turn their
|
|
207
|
+
speaker volume up, which the instructions screen does. For sandbox links,
|
|
208
|
+
include Soliton's
|
|
209
|
+
[testing data policy](https://soliton.id/testing-data), which the
|
|
210
|
+
instructions screen would otherwise show.
|
|
211
|
+
2. **Let every iframe pass on camera, microphone and autoplay.** Each iframe
|
|
212
|
+
between the browser window and the hosted page, including yours, needs
|
|
213
|
+
`allow="camera; microphone; autoplay; fullscreen"`. The SDK's own iframe
|
|
214
|
+
already sets it.
|
|
215
|
+
3. **Configure your WebView if your page runs inside a native app.** A WebView
|
|
216
|
+
needs the camera and microphone grants below even without skipping; the
|
|
217
|
+
autoplay setting is what removes the extra tap.
|
|
218
|
+
|
|
219
|
+
```swift
|
|
220
|
+
// iOS: the WKWebView that loads your page. Info.plist needs
|
|
221
|
+
// NSCameraUsageDescription and NSMicrophoneUsageDescription.
|
|
222
|
+
let config = WKWebViewConfiguration()
|
|
223
|
+
config.allowsInlineMediaPlayback = true
|
|
224
|
+
config.mediaTypesRequiringUserActionForPlayback = []
|
|
225
|
+
let webView = WKWebView(frame: .zero, configuration: config)
|
|
226
|
+
webView.uiDelegate = self
|
|
227
|
+
|
|
228
|
+
func webView(_ webView: WKWebView, requestMediaCapturePermissionFor origin: WKSecurityOrigin,
|
|
229
|
+
initiatedByFrame frame: WKFrameInfo, type: WKMediaCaptureType,
|
|
230
|
+
decisionHandler: @escaping (WKPermissionDecision) -> Void) {
|
|
231
|
+
// `origin` is your top-level page; `frame` is the Soliton iframe asking.
|
|
232
|
+
let asking = frame.securityOrigin
|
|
233
|
+
decisionHandler(asking.protocol == "https" && asking.host == "soliton.id" ? .grant : .prompt)
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
```kotlin
|
|
238
|
+
// Android: the WebView that loads your page. Request CAMERA and RECORD_AUDIO
|
|
239
|
+
// at runtime first; the manifest needs both.
|
|
240
|
+
webView.settings.apply {
|
|
241
|
+
javaScriptEnabled = true
|
|
242
|
+
domStorageEnabled = true
|
|
243
|
+
mediaPlaybackRequiresUserGesture = false
|
|
244
|
+
}
|
|
245
|
+
webView.webChromeClient = object : WebChromeClient() {
|
|
246
|
+
override fun onPermissionRequest(request: PermissionRequest) {
|
|
247
|
+
val asking = request.origin // the Soliton iframe's origin
|
|
248
|
+
if (asking.scheme != "https" || asking.host != "soliton.id") return request.deny()
|
|
249
|
+
request.grant(request.resources.filter {
|
|
250
|
+
it == PermissionRequest.RESOURCE_VIDEO_CAPTURE || it == PermissionRequest.RESOURCE_AUDIO_CAPTURE
|
|
251
|
+
}.toTypedArray())
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
React Native WebView: `mediaPlaybackRequiresUserAction={false}`,
|
|
257
|
+
`allowsInlineMediaPlayback` and
|
|
258
|
+
`mediaCapturePermissionGrantType="grantIfSameHostElsePrompt"`, plus the same
|
|
259
|
+
Info.plist and Android permissions.
|
|
260
|
+
|
|
261
|
+
What users then see: Standard opens the camera with no tap. Medium and High
|
|
262
|
+
start their sound as soon as the camera is on, with no tap, in Safari, Chrome
|
|
263
|
+
and Firefox. In an Android WebView without `mediaPlaybackRequiresUserGesture =
|
|
264
|
+
false`, which includes in-app browsers such as Instagram or Facebook on
|
|
265
|
+
Android, the user taps Proceed once. There is no Back button to the
|
|
266
|
+
instructions screen.
|
|
267
|
+
|
|
190
268
|
## Callback semantics
|
|
191
269
|
|
|
192
270
|
An integration that provides its own completion screen can opt out of the
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"//": "Publishable manifest for the npm Web SDK. No devDependencies and no own node_modules by design: every build runs from the front-end repository root with its existing toolchain (npm run build:sdk), so the lockfile never grows for packaging. dist/ is rebuilt automatically by the prepack hook and is not committed.",
|
|
3
3
|
"name": "@soliton-id/web-sdk",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"description": "Soliton identity verification for the browser: opens the hosted verification flow in a full-viewport overlay iframe on your page and reports lifecycle events. Verdicts and portraits are fetched by your backend, never exposed in the browser.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Soliton",
|