const {
RequestedLivenessCheckBuilder,
SdkConfigBuilder,
SessionSpecificationBuilder,
} = require('yoti');
// Active liveness check with 3 retries
const livenessCheck = new RequestedLivenessCheckBuilder()
.forZoomLiveness()
.withMaxRetries(3)
.build();
// Configuration for the client SDK (Frontend)
const sdkConfig = new SdkConfigBuilder()
.withAllowsCameraAndUpload()
.withPresetIssuingCountry('GBR')
.withSuccessUrl('https://localhost:8443/success')
.withErrorUrl('https://localhost:8443/error')
.build();
// Build the Session specification
const sessionSpec = new SessionSpecificationBuilder()
.withClientSessionTokenTtl(900)
.withResourcesTtl(90000)
.withUserTrackingId('some-user-tracking-id')
.withRequestedCheck(livenessCheck)
.withSdkConfig(sdkConfig)
.build();
import com.yoti.api.client.docs.session.create.check.RequestedLivenessCheck;
import com.yoti.api.client.docs.session.create.SdkConfig;
import com.yoti.api.client.docs.session.create.SessionSpec;
...
// Active liveness check with 3 retries
RequestedLivenessCheck livenessCheck = RequestedLivenessCheck.builder()
.forZoomLiveness()
.withMaxRetries(3)
.build()
// Configuration for the client SDK (Frontend)
SdkConfig sdkConfig = SdkConfig.builder()
.withAllowsCameraAndUpload()
.withPresetIssuingCountry("GBR")
.withSuccessUrl("https://localhost:8443/success")
.withErrorUrl("https://localhost:8443/error")
.build();
// Build the Session specification
SessionSpec sessionSpec = SessionSpec.builder()
.withClientSessionTokenTtl(900)
.withResourcesTtl(90000)
.withUserTrackingId("some-user-tracking-id")
.withSdkConfig(sdkConfig)
.withRequestedCheck(livenessCheck)
.build();
<?php
require_once './vendor/autoload.php';
use Yoti\DocScan\Session\Create\Check\RequestedLivenessCheckBuilder;
use Yoti\DocScan\Session\Create\SdkConfigBuilder;
use Yoti\DocScan\Session\Create\SessionSpecificationBuilder;
// Active liveness check with 3 retries
$livenessCheck = (new RequestedLivenessCheckBuilder())
->forZoomLiveness()
->withMaxRetries(3)
->build()
// Configuration for the client SDK (Frontend)
$sdkConfig = (new SdkConfigBuilder())
->withAllowsCameraAndUpload()
->withPresetIssuingCountry('GBR')
->withSuccessUrl('https://localhost:8443/success')
->withErrorUrl('https://localhost:8443/error')
->build()
// Build the Session specification
$sessionSpec = (new SessionSpecificationBuilder())
->withClientSessionTokenTtl(900)
->withResourcesTtl(90000)
->withUserTrackingId('some-user-tracking-id')
->withRequestedCheck($livenessCheck)
->withSdkConfig($sdkConfig)
->build();
from yoti_python_sdk.doc_scan import (
RequestedLivenessCheckBuilder,
SdkConfigBuilder,
SessionSpecBuilder
)
# Active liveness check with 3 retries
liveness_check = RequestedLivenessCheckBuilder()
.for_zoom_liveness()
.with_max_retries(3)
.build()
# Configuration for the client SDK (Frontend)
sdk_config = (
SdkConfigBuilder()
.with_allows_camera_and_upload()
.with_preset_issuing_country("GBR")
.with_success_url("https://localhost:8443/success")
.with_error_url("https://localhost:8443/error")
.build()
)
# Build the Session specification
session_spec = (
SessionSpecBuilder()
.with_client_session_token_ttl(900)
.with_resources_ttl(90000)
.with_user_tracking_id("some-user-tracking-id")
.with_requested_check(liveness_check)
.with_sdk_config(sdk_config)
.build()
)
using Yoti.Auth.DocScan.Session.Create;
using Yoti.Auth.DocScan.Session.Create.Check;
// Active liveness check with 3 retries
var livenessCheck = new RequestedLivenessCheckBuilder()
.ForZoomLiveness()
.WithMaxRetries(3)
.Build();
// Configuration for the client SDK (Frontend)
var sdkConfig = new SdkConfigBuilder()
.WithAllowsCameraAndUpload()
.WithPresetIssuingCountry("GBR")
.WithSuccessUrl("https://localhost:8443/success")
.WithErrorUrl("https://localhost:8443/error")
.Build();
// Build the Session specification
var sessionSpec = new SessionSpecificationBuilder()
.WithClientSessionTokenTtl(900)
.WithResourcesTtl(90000)
.WithUserTrackingId("some-user-tracking-id")
.WithRequestedCheck(livenessCheck)
.WithSdkConfig(sdkConfig)
.Build();
import (
"github.com/getyoti/yoti-go-sdk/v3/docscan/session/create"
"github.com/getyoti/yoti-go-sdk/v3/docscan/session/create/check"
)
// Active liveness check with 3 retries
var livenessCheck *check.RequestedLivenessCheck
livenessCheck, err = check.NewRequestedLivenessCheckBuilder()
.ForZoomLiveness()
.WithMaxRetries(3)
.Build()
if err != nil {
return nil, err
}
// Configuration for the client SDK (Frontend)
var sdkConfig *create.SDKConfig
sdkConfig, err = create.NewSdkConfigBuilder().
WithAllowsCameraAndUpload().
WithPresetIssuingCountry("GBR").
WithSuccessUrl("https://localhost:8443/success").
WithErrorUrl("https://localhost:8443/error")
Build()
if err != nil {
return nil, err
}
// Build the Session specification
var sessionSpec *create.SessionSpecification
sessionSpec, err = create.NewSessionSpecificationBuilder().
WithClientSessionTokenTTL(900).
WithResourcesTTL(90000).
WithUserTrackingID("some-tracking-id").
WithRequestedCheck(livenessCheck).
WithSDKConfig(sdkConfig).
Build()
if err != nil {
return nil, err
}
{
"client_session_token_ttl": 900,
"resources_ttl": 90000,
"user_tracking_id": "some-user-tracking-id",
"requested_checks": [
{
"type": "LIVENESS",
"config": {
"liveness_type": "ZOOM",
"max_retries": 3
}
},
],
"requested_tasks": [],
"sdk_config": {
"allowed_capture_methods": "CAMERA_AND_UPLOAD",
"locale": "en-GB",
"preset_issuing_country": "GBR",
"success_url": "https://localhost:8443/success",
"error_url": "https://localhost:8443/error"
}
}