Getting Started
Import the library
You can include the library as a regular script tag on your page:
<script src="https://storage.googleapis.com/westudents-public/scripts/verify-sdk.js"></script>
Initialize the SDK
StudentVerificationSDK.init({
apiKey: 'YOUR-API-KEY',
userExternalId: 'USER-ID',
onCompleted: ({ userId, verified, status }) => {
// handle verification response here
},
options: {
// optional configs
wsLoginEnabled: true,
electronicRegisterEnabled: false
}
})
Params
apiKey: string required
Your personal api key. If you do not yet have one, visit this page.
userExternalId: string (optional)
You can pass an ID to link verification requests to the user. If you do not pass an ID, it will be automatically generated.
onCompleted: function (optional)
A callback function triggered after verification flow ends.
Params:
userId: string: The user identifier specified or autogenerated.verified: boolean: Boolean value for verification status.status: string: Status of the latest request done. Could bePENDING,REJECTEDorVERIFIED.
Possible values:
| METHOD | verified | status |
|---|---|---|
false | PENDING, REJECTED | |
| Documents | false | PENDING, REJECTED |
| Electronic Register | true, false | VERIFIED, REJECTED |
| Login with WS | true, false | VERIFIED, REJECTED |
options (optional)
Configuration options:
wsLoginEnabled: boolean: Enable verification through the login with WeStudents app. Default:true.electronicRegisterEnabled: boolean: Enable verification through electronic registers APIs. Default:true.