Web SDK Reference
Class CredoAppService(url, authKey)
CredoAppService(url, authKey)
CredoAppService(url, authKey)
CredoAppService enables the tracking of user behavior and the capture of a user’s digital footprint. The collected information is uploaded to the credolab web service for future use as scorecards and fragments.
Creates an instance of the CredoAppService
with a target configuration:
Parameters:
Name | Description | Type |
---|---|---|
url | The URL of credolab service | String |
authKey | An authentication key can be obtained from the credolab team. | String |
Method startTracking()
startTracking()
startTracking()
- The method is intended to start the tracking of user behavior on the page where the credolab SDK is integrated.
Method stopTracking()
stopTracking()
stopTracking()
- The method is intended to stop the tracking of the user behavior on the page where the credolab SDK is integrated.
Method stopTrackingAndCompleteAsync(referenceNumber)
stopTrackingAndCompleteAsync(referenceNumber)
stopTrackingAndCompleteAsync(referenceNumber): Promise<void | CredoAppException>
- This method is intended to terminate the tracking, collecting and uploading of data to the credolab web service. If the method executes successfully, it means that the dataset is considered completed, and the reference number cannot be used again.
Parameters:
Name | Description | Type |
---|---|---|
referenceNumber | Unique identifier intended to associate dataset, uploaded to credolab web service, with a record on the lender side. (The max length of 100 characters). | String |
Returns:
Type | Description |
---|---|
Promise<void | CredoAppException> | Promise result contains an object that represents the eventual completion (or failure) of an asynchronous operation. If an error occurs, CredoAppException will be passed to the failure with the error detail |
Class CredoAppServiceAsync(url, authKey)
CredoAppServiceAsync(url, authKey)
CredoAppServiceAsync(url, authKey)
With CredoAppServiceAsync
, users' behavior and digital footprint data are continuously tracked from different devices, and they are uploaded continuously to the credolab web service for processing into scorecards and fragments.
Creates an instance of the CredoAppServiceAsync
with a target configuration:
Parameters:
Name | Description | Type |
---|---|---|
url | The URL of credolab service | String |
authKey | An authentication key can be obtained from the credolab team. | String |
Method startTrackingAsync(referenceNumber)
startTrackingAsync(referenceNumber)
startTrackingAsync(referenceNumber): Promise<void | CredoAppException>
- The method is intended to start the tracking of user behavior data and continuously upload it to the credolab web server.
Please note that it is not possible to initiate tracking with a new reference number if there is already ongoing tracking associated with another number. In such cases, an error will be returned, indicating that tracking for a certain reference number is currently in progress.
Parameters:
Name | Description | Type |
---|---|---|
referenceNumber | Unique identifier intended to associate dataset, uploaded to credolab web service, with a record on the lender side. (The max length of 100 characters). | String |
Returns:
Type | Description |
---|---|
Promise<void | CredoAppException> | Promise result contains an object that represents the eventual completion (or failure) of an asynchronous operation. If an error occurs, CredoAppException will be passed to the failure with the error detail |
Method stopTrackingAsync()
stopTrackingAsync()
stopTrackingAsync(): Promise<void | CredoAppException>
- The method is intended to stop the tracking of the user behavior on the page where the credolab SDK is integrated.
Returns:
Type | Description |
---|---|
Promise<void | CredoAppException> | Promise result contains an object that represents the eventual completion (or failure) of an asynchronous operation. If an error occurs, CredoAppException will be passed to the failure with the error detail |
Method stopTrackingAndCompleteAsync()
stopTrackingAndCompleteAsync()
stopTrackingAndCompleteAsync(): Promise<void | CredoAppException>
- This method is intended to stop the tracking, collect data from the browser, and upload it to the credolab web service along with behavioral data. If the method executes successfully, it means that the dataset is considered completed, and the reference number (used in
startTrackingAsync
method) cannot be used again.
Parameters:
Name | Description | Type |
---|---|---|
referenceNumber | Unique identifier intended to associate dataset, uploaded to credolab web service, with a record on the lender's side. (The max length of 100 characters). | String |
Returns:
Type | Description |
---|---|
Promise<void | CredoAppException> | Promise result contains an object that represents the eventual completion (or failure) of an asynchronous operation. If an error occurs, CredoAppException will be passed to the failure with the error detail |
Return type promise<void | CredoAppException>
promise<void | CredoAppException>
Promise result contains an object that represents the eventual completion (or failure) of an asynchronous operation. If an error occurs, CredoAppException
will be passed to the failure with error details.
Class CredoAppException
CredoAppException
This exception is passed to the Promise
failure results when the credolab SDK is unable to complete an action.
Method getMessage()
getMessage()
getMessage()
Returns:
Type | Description |
---|---|
String | Get detailed information about the error that occurred |
Method getCode()
getCode()
getCode()
Returns:
Type | Description |
---|---|
Number | Get error code |
Members:
credolab informs API clients of both the high-level error class (using the status code) and the finer-grained details of the problem. The latest approach is [RFC 7807]-based.
Property | Description |
---|---|
Status integer | Returns code of the error. Please refer to the error codes table |
Title string | A short, human-readable summary of the problem type. |
Detail string | A human-readable explanation is specific to this occurrence of the problem. |
Type string | A URI reference that identifies the problem type. |
Error Codes
Code | Reason | Description |
---|---|---|
30 | Tracking is not started successfully | startTracking() action has not started correctly due to e.g. reference number provided was expired or completed (the related error has been received earlier) |
31 | Tracking in progress | Tracking for a specific reference number is currently in progress. To track a different number, you will need to stop tracking the current one. |
40 | Value is invalid | The value is invalid. Example: Auth key is invalid Url is invalid |
41 | The Dataset state is invalid | The reference number is not unique Dataset is in a complete state A reference number is expired |
42 | Auth credentials are incorrect or action forbidden | The provided credentials don't match. |
50 | Server error | Something is wrong with the server. |
90 | Unknown error | An unexpected error occurred. |
Updated 10 months ago