Events

For Unicus SDK Web you will receive the following events in your website which will help you know what step the process is executing and the result of a transaction.

How to subscribe to SDK Web events?

Interesting: In addition to the Webhooks where you can have server-side response of the flow of your users, you can also do it from the following feature.

Unicus button load

Add the following listener to detect when the Unicus Button is finished loading.

/* Add listener by pointing to the Unicus Button */
const unicusButton = document.createElement("unicus-btn");

unicusButton.addEventListener('OnUnicus:loaded', function(event) {
  console.log('Unicus loaded with transaction detail: ', event.detail)
});

Keep in mind the following convention to know what each object means in the response corresponding to this Event.

status_error

Boolean

Defines whether an error occurred during service loading or related to the pending process.

loaded

Boolean

Defines whether the process loaded correctly

message

String

Provides an immediate response message to the customer to let them know how the process was completed

link

String

Gives the customer the option to open the Web help modal himself.

transaction

Object

Provides an object with transaction data

transaction.transactionId

String

Corresponds to the transaction ID

transaction.clientid

String

Corresponds to the identification of the customer with whom the transaction is to be carried out.

Events Details

Enrollment with document and verification

Add the following addEventListener to listen when the user has an active transaction.

Liveness

Name
Type
Description

status_error

Booleano

Defines whether an error occurred during service loading or related to the pending process.

message

String

Provides an immediate response message to the customer to let them know how the process was completed

transaction

Object

Provides an object with data from the transaction process

transaction.state

Object

Provides an object with data on the status of the transaction performed.

transaction.state.additionalSessionData

Object

Provides an object with transaction session data.

transaction.state.faceScanSecurityChecks

Object

Provides an object with data from the performed face scan.

Enrollment

Name
Type
Description

status_error

Booleano

Defines whether an error occurred during service loading or related to the pending process.

message

String

Provides an immediate response message to the customer to let them know how the process was completed

transaction

Object

Provides an object with data from the transaction process

transaction.state

Object

Provides an object with data on the status of the transaction performed.

transaction.state.additionalSessionData

Object

Provides an object with transaction session data.

transaction.state.faceScanSecurityChecks

Object

Provides an object with data from the performed face scan.

Verify

Name
Type
Description

status_error

Booleano

Defines whether an error occurred during service loading or related to the pending process.

message

String

Provides an immediate response message to the customer to let them know how the process was completed

transaction

Object

Provides an object with data from the transaction process

transaction.state

Object

Provides an object with data on the status of the transaction performed.

transaction.state.additionalSessionData

Object

Provides an object with transaction session data.

transaction.state.faceScanSecurityChecks

Object

Provides an object with data from the performed face scan.

Check result codes

Transaction Completion

Add the following addEventListener to listen when the user has a completed transaction.

Nombre

Tipo

Descripción

status_error

Boolean

Defines whether an error occurred during service loading or related to the pending process.

message

String

Provides an immediate response message to the customer to let them know how the process was completed

transaction

Object

Provides an object including the final state of the transaction

transaction.exited

Boolean

Provides a value given the case true or false

transaction.transactionId

String

Corresponds to the ID

Transaction error

Add the following addEventListener to listen when the user has a completed transaction.

Nombre

Tipo

Descripción

status_error

Boolean

Defines whether an error occurred during service loading or related to the pending process.

message

String

Provides an immediate response message to the customer to let them know how the process was completed

details

Object

Contains the error detail or description

Última actualización

¿Te fue útil?