The Connect Service is used to create, manage, and retrieve Identity Verification Sessions for Trinsic Connect.
Trinsic Connect is a reusable Identity Verification platform that minimizes user friction by allowing them to securely reuse the results of an identity verification
performed previously on the platform, reducing the number of full verification flows they experience.
Closed Beta
Trinsic Connect is currently in a closed beta; please contact us to gain early access.
Populate verifications with a single RequestedVerification object, with a type of GOVERNMENT_ID. In future, multiple verification types
will be supported in a single session.
In the returned session object, handle the following values appropriately:
See Get Verification Results to understand how to fetch and process the resultant identity data.
import{TrinsicService}from"@trinsic/trinsic";consttrinsic=newTrinsicService({authToken:"<auth token>"});constcreateResponse=awaittrinsic.connect().createSession({verifications:[{type:VerificationType.GOVERNMENT_ID}]});constsession=createResponse.session;constsessionId=session.id;// Save this in your databaseconstclientToken=session.clientToken;// Send this to your user's device
varcreateResponse=awaittrinsic.Connect.CreateSessionAsync(new(){Verifications={newRequestedVerification(){Type=VerificationType.GovernmentId}}});varsession=createResponse.Session;varsessionId=session.Id;// Save this in your databasevarclientToken=session.ClientToken;// Send this to your user's device
The image(s) provided for this verification were either too low-quality, not of the correct type, or otherwise unable to be processed. This failure reason is non-terminal; the user is able to retry the verification.
The document provided is either of an unsupported type, or from an unsupported country.
session.verifications[key].reused
bool
Whether this was a reused (true) or fresh (false) verification. If state is not VERIFICATION_SUCCESS, this field is false and does not convey useful information.
session.verifications[key].begun
fixed64
The unix timestamp, in seconds, when this verification was begun by the user -- or 0 if not yet begun.
session.verifications[key].updated
fixed64
The unix timestamp, in seconds, when this verification last changed state -- or 0 if it has not yet begun.
The reason for the IDVSession's failure. Only set if state is IDV_FAILED.
Show enum values
SessionFailCode.SESSION_FAIL_NONE
= 0
The Session is not in a failure state.
SessionFailCode.SESSION_FAIL_INTERNAL
= 1
An internal Trinsic error caused this session to fail
SessionFailCode.SESSION_FAIL_VERIFICATION_FAILED
= 2
The session failed because one or more of the verifications failed. The reason for the failure is present in the fail_reason field of the relevant Verification object(s).
SessionFailCode.SESSION_FAIL_AUTHENTICATION
= 3
The session failed because the user failed to authenticate with their phone number too many times.
SessionFailCode.SESSION_FAIL_EXPIRED
= 4
The session expired
SessionFailCode.SESSION_FAIL_USER_CANCELED
= 5
The user canceled / rejected the session
SessionFailCode.SESSION_FAIL_RP_CANCELED
= 6
The RP canceled the session
session.result_vp
string
The resultant signed VP combining the results of all verifications
session.created
fixed64
The unix timestamp, in seconds, that this IDVSession was created
session.updated
fixed64
The unix timestamp, in seconds, that this IDVSession's state was last updated
If the Session has been completed successfully, the results will be available in the result_vp field of the returned Session. See Get Verification Results for information on parsing this field.
If the Session failed for any reason (cancellation, identity verification failure, expiration, etc.), the failure reason will be given by the fail_code field.
The image(s) provided for this verification were either too low-quality, not of the correct type, or otherwise unable to be processed. This failure reason is non-terminal; the user is able to retry the verification.
The document provided is either of an unsupported type, or from an unsupported country.
session.verifications[key].reused
bool
Whether this was a reused (true) or fresh (false) verification. If state is not VERIFICATION_SUCCESS, this field is false and does not convey useful information.
session.verifications[key].begun
fixed64
The unix timestamp, in seconds, when this verification was begun by the user -- or 0 if not yet begun.
session.verifications[key].updated
fixed64
The unix timestamp, in seconds, when this verification last changed state -- or 0 if it has not yet begun.
The reason for the IDVSession's failure. Only set if state is IDV_FAILED.
Show enum values
SessionFailCode.SESSION_FAIL_NONE
= 0
The Session is not in a failure state.
SessionFailCode.SESSION_FAIL_INTERNAL
= 1
An internal Trinsic error caused this session to fail
SessionFailCode.SESSION_FAIL_VERIFICATION_FAILED
= 2
The session failed because one or more of the verifications failed. The reason for the failure is present in the fail_reason field of the relevant Verification object(s).
SessionFailCode.SESSION_FAIL_AUTHENTICATION
= 3
The session failed because the user failed to authenticate with their phone number too many times.
SessionFailCode.SESSION_FAIL_EXPIRED
= 4
The session expired
SessionFailCode.SESSION_FAIL_USER_CANCELED
= 5
The user canceled / rejected the session
SessionFailCode.SESSION_FAIL_RP_CANCELED
= 6
The RP canceled the session
session.result_vp
string
The resultant signed VP combining the results of all verifications
session.created
fixed64
The unix timestamp, in seconds, that this IDVSession was created
session.updated
fixed64
The unix timestamp, in seconds, that this IDVSession's state was last updated
The image(s) provided for this verification were either too low-quality, not of the correct type, or otherwise unable to be processed. This failure reason is non-terminal; the user is able to retry the verification.
The document provided is either of an unsupported type, or from an unsupported country.
session.verifications[key].reused
bool
Whether this was a reused (true) or fresh (false) verification. If state is not VERIFICATION_SUCCESS, this field is false and does not convey useful information.
session.verifications[key].begun
fixed64
The unix timestamp, in seconds, when this verification was begun by the user -- or 0 if not yet begun.
session.verifications[key].updated
fixed64
The unix timestamp, in seconds, when this verification last changed state -- or 0 if it has not yet begun.
The reason for the IDVSession's failure. Only set if state is IDV_FAILED.
Show enum values
SessionFailCode.SESSION_FAIL_NONE
= 0
The Session is not in a failure state.
SessionFailCode.SESSION_FAIL_INTERNAL
= 1
An internal Trinsic error caused this session to fail
SessionFailCode.SESSION_FAIL_VERIFICATION_FAILED
= 2
The session failed because one or more of the verifications failed. The reason for the failure is present in the fail_reason field of the relevant Verification object(s).
SessionFailCode.SESSION_FAIL_AUTHENTICATION
= 3
The session failed because the user failed to authenticate with their phone number too many times.
SessionFailCode.SESSION_FAIL_EXPIRED
= 4
The session expired
SessionFailCode.SESSION_FAIL_USER_CANCELED
= 5
The user canceled / rejected the session
SessionFailCode.SESSION_FAIL_RP_CANCELED
= 6
The RP canceled the session
session.result_vp
string
The resultant signed VP combining the results of all verifications
session.created
fixed64
The unix timestamp, in seconds, that this IDVSession was created
session.updated
fixed64
The unix timestamp, in seconds, that this IDVSession's state was last updated
In scenarios where a relying party (or attestation provider) wants to preemptively check whether or not a user has a reusable credential, the HasValidCredential method runs a headless verification flow with the provided identity. It returns a boolean value, true if the identity has a reusable credential false otherwise.
No PII will be included in the response, if you are interested in obtaining results you will need to invoke a verification flow on the client.
Once a Session has been created, the verification flow must be run on your end-user's device, using the client_token returned during Session creation.
import{ConnectClient}from"@trinsic/trinsic";constclientToken="";// Client Token must come from your backendconstconnectClient=newConnectClient();// The identityVerification() function opens the Trinsic Connect flow in an// iframe on your page, and returns a Promise that resolves or rejects // when the flow is completed successfully or unsuccessfully.connectClient.identityVerification(clientToken).finally(()=>{// Session has been completed; ping your backend to fetch the results// and move forward with your flow.});