verify() to launch the employment verification widget.
Constructor
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | TranscryptsOptions | Yes | Configuration options for the SDK. |
Exceptions
| Error message | Condition |
|---|---|
Transcrypts: apiKey is required | options.apiKey is falsy or missing. |
Examples
Basic initialization:verify(options)
document.body as a fixed-position overlay. Body scroll is disabled while the widget is open. The overlay and iframe are removed automatically when the verification completes, fails, or is dismissed by the user.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | VerifyOptions | Yes | Verification options including SSN and optional user info. |
Returns
Promise<VerificationResult> — Resolves with a VerificationResult object.
Promise Resolution Scenarios
| Scenario | success | verified | error |
|---|---|---|---|
| Verification succeeded | true | true | undefined |
| User closed the widget | false | false | { code: 'USER_CLOSED', message: 'User closed the verification widget' } |
| User pressed Escape key | false | false | { code: 'USER_CLOSED', message: 'User closed the verification widget' } |
| User clicked backdrop | false | false | { code: 'USER_CLOSED', message: 'User closed the verification widget' } |
Promise Rejection Scenarios
| Scenario | Error message |
|---|---|
options.ssn is falsy | Transcrypts: ssn is required |
| Verification failed | Message from widget payload, or 'Verification failed' as fallback |
Example
on(eventType, callback)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
eventType | TranscryptsEventType | Yes | The event type to listen for. |
callback | (event: TranscryptsEvent) => void | Yes | Function called when the event fires. |
Returns
() => void — An unsubscribe function. Call it to remove the callback.