Smart Auth
Remote
Include the .js file directly from the CDN:
<script
src="https://repo.combateafraude.com/identity/<VERSION>/index.umd.js"
type="text/javascript"
></script>Current versions
Utilization
Creating an SDK instance
The SDK's constructor method takes the Identity token as a parameter (see how to get yours here). In addition, you can optionally enter the SDK's initialization options.
Example using import via CDN:
<script
src="https://repo.combateafraude.com/identity/<VERSION>/index.umd.js"
type="text/javascript"
></script>
[...]
<script>
const identityToken = "your token";
const identity = new this["@combateafraude/identity-sdk"].Sdk(identityToken);
</script>Options parameters:
Field
Type
Required?
Description
throwOnRecall
boolean
No
Indicates whether, when called a second time without the first call having completed, the SDK should throw an error. If not entered or entered false, the SDK returns the existing Promise without triggering an error. If true, the SDK rejects the Promise on the second call.
pendingPageSettings
object
No
To see all the parameters available in the pendingPageSettings click here.
authIcon
string
No
Icon used at the top of the authentication screens
enableTimer
boolean
No
Enables or disables the timer in case of SMS and E-mail validation
enableLocationRetry
boolean
No
Enables retry on geolocation collect, without high accuracy on second try. The default value is false.
gpsAuthenticationSettings
object
No
To see all the parameters available in the gpsAuthenticationSettings click here.
successPageDisplayDuration
number
No
Time in milliseconds that the result page (success or error) remains visible before closing automatically. Default: 3000.
timerPosition
string
No
Position of timer in case of SMS and E-mail validation (can be "DOWN" or "UP" )
language
string
No
Defines the used language on SDK's texts default: pt-BR
metadata
string
No
This field only accepts strings formatted in JSON. Therefore, when submitting data to this field, the string must be in valid JSON format.
*You must inform mobileToken when you are using facial authentication in your policy
Theme parameters:
Field
Type
Required?
Description
closeButton
string
No
Color used in the close button
checkmark
string
No
Color used in the checkMark button
loader
string
No
Color used in the loader button
buttonSuccessColor
string
No
Color used in the success button
buttonSuccessTextColor
string
No
Color used in text of the success button
inputSuccessColor
string
No
Color used in code input
buttonFinishColor
string
No
Color used in code input
timerBackgroundColor
string
No
Color used in the background of the timer if it is active
timerColor
string
No
Color used in the timer text if it is active
modalBackgroundColor
string
No
Color used in background of the authentication modal
textColor
string
No
Color used in text of the authentication modal
Label parameters:
Field
Type
Required?
Description
enable
string
No
Enables or disables the label
link
string
No
Redirection link
text
string
No
Text used in the label
pendingPageSettings parameters:
Field
Type
Required?
Description
pendingIconSvg
string
No
Changes the icon showed when the PendingPage is open
titleText
string
No
Title of the PendingPage
descriptionText
string
No
Description of the PendingPage
buttonContentText
string
No
Text used in the PendingPage confirm button
faceLivenessSettings parameters:
Field
Type
Required?
Description
titleText
string
No
Title of the faceLivenessPage
subtitleText
string
No
Subtitle of the faceLivenessPage
descriptionText
string
No
Description of the faceLivenessPage
gpsAuthenticationSettings parameters:
Field
Type
Required?
Description
maxAttempts
number
No
Maximum number of GPS collection attempts during the authentication flow. Default: 3.
smsSettings parameters:
Field
Type
Required?
Description
titleText
string
No
Title of the smsCodePage
subtitleText
string
No
Subtitle of the smsCodePage
buttonContentText
string
No
Text used in the smsCodePage confirm button
emailSettings parameters:
Field
Type
Required?
Description
titleText
string
No
Title of the emailCodePage
subtitleText
string
No
Subtitle of the emailCodePage
buttonContentText
string
No
Text used in the emailCodePage confirm button
styles parameters:
Field
Type
Required?
Description
label
string
No
Changes text on button
color
string
No
Changes color of text on button
backgroundColor
string
No
Changes color of background
borderRadius
string
No
Changes border radius
border
string
No
Changes border
Exemple:
Calling the SDK:
To verify a user, use the verifyPolicy method, available in the SDK instance.
You must enter the user's personId and the policy ID to be used.
Last updated

