HomeAge Verification HeadlessAI Services for TerminalsAge Estimation VerifySupportTrust APIIdentity Verification LivenessDigital IDIdentity verificationDigital ID MigrationDBS RTWDigital IDDBS/RTW portaleSignaturesAge verificationAge estimationIn-Branch VerificationAge Estimation v2idv-portal-errorsIdentity ProfilesVerifiable Credentialssandbox-betaIdentity Verification APIAI Services APITrust APIProof of Age (PoA) API
Digital ID
v9.0
Title
Message
Create new category
What is the title of your new category?
Edit page index title
What is the title of the page index?
Edit category
What is the new title of your category?
Edit link
What is the new title and URL of your link?
Create a Share session
AI Tools
Summarize Page
Copy Markdown
Open in ChatGPT
Open in Claude
Connect to Cursor
Connect to VS Code
After initialising the Yoti Identity Client, the next step is to configure your backend application to create a Share session. The Yoti SDKs enable integrators to dynamically create these sessions by defining a session configuration. A unique session would also include a share policy, which is a set of requested attributes or schemes for the sharing process.
Build a policy
A policy is used to define what attributes are requested from the user. You can use the policy builder to define what attributes are needed.
Node.js
Java
PHP
C#
Go
x
const { DigitalIdentityBuilders: { PolicyBuilder }} = require('yoti');const policy = new PolicyBuilder() // using a predefined method to add an attribute .withFullName() .withEmail() // if you wish the user to prove it's them by taking a selfie on share .withSelfieAuthentication() .build();Specify the Session configuration
The Session configuration is built using:
- The policy.
- The redirect URI for share completion. This is where the user will be redirected to after the share is completed. A receiptId query parameter will be added to the URL. You can use this to retrieve the user profile from the share.
- A subject Id (optional).
- A notification webhook (optional).
- Any extensions.
Node.js
Java
PHP
C#
Go
const { DigitalIdentityBuilders: { ShareSessionNotificationBuilder, ShareSessionConfigurationBuilder }} = require('yoti');const notification = new ShareSessionNotificationBuilder() .withUrl("your-webhook-url") .withMethod("POST") .withHeader("Authorization", "<Bearer_token>") // Optional .withVerifiedTls(true) // Optional .build();const subject = { subject_id: 'some_subject_id_string',};const shareSessionConfig = new ShareSessionConfigurationBuilder() .withRedirectUri("/your-callback-url") .withPolicy(policy) .withSubject(subject) .withNotification(notification) .build();Create a Share session
Using the session configuration defined above, you can request the creation of a Share session that will be used by the Yoti Webshare script to generate a Yoti QR.
Node.js
Java
PHP
C#
Go
yotiClient.createShareSession(shareSessionConfig) .then((shareSessionResult) => { const shareSession = shareSessionResult; const shareSessionId = shareSession.getId(); }).catch((error) => { console.error(error.message); });Error codes
| Error code | Description |
|---|---|
| 400 | Invalid request payload sent |
| 400 | One or more of the specified attributes are not known |
| 403 | Service is disabled |
| 403 | Service does not belong to an organisation |
| 403 | Organisation status must be PENDING or VERIFIED to perform shares |
| 403 | Service isn’t allowed to request the specified 3rd party attribute |
| 403 | Service isn’t allowed to issue the specified 3rd party attribute |
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
Last updated on
Was this page helpful?
Next to read:
Render QR buttonGot a question? Contact us here.
Discard Changes
Do you want to discard your current changes and overwrite with the template?
Archive Synced Block
Message
Create new Template
What is this template's title?
Delete Template
Message