API Reference
Configuration Function
setApiKey
setApiKey(apiKey: string): Promise<boolean>
Sets the API key for the Captur SDK.
setDelay
setDelay(delay: number): Promise<void>
Sets the delay in seconds before the SDK starts scanning. The default is 1 second.
setTimeout
setTimeout(timeout: number): Promise<void>
Sets the length, in seconds, for the verification process to times out.
prepareModel
prepareModel(locationName: string, assetType: string, latitude: number, longitude: number): Promise<boolean>
Checks for latest model for a specific locationName and assetType, and loads that in memory, available for the SDK to start scanning.
getConfig
getConfig(locationName: string, assetType: string, latitude: number, longitude: number): Promise<boolean>
Gets the configuration for a specific coordinate (latitude and longitude), or locationName
Camera Component
CapturCameraView
A React Native component that displays the camera feed and processes frames for verification.
style: ViewStyle - The style for the camera view
startVerification: boolean - Whether to start the verification process
isFlashOn: boolean - Whether to turn on the flash
isZoomedIn: boolean - Whether to zoom in the camera
referenceId: string (optional) - A unique reference ID for this verification
Event Handling
subscribeToEvents
subscribeToEvents(callbacks: EventCallbacks): () => void
Subscribes to events from the SDK. Returns an unsubscribe function.
Callback types:
interface EventCallbacks {
capturDidGenerateEvent?: (
capturCameraState: CapturCameraState,
metadata?: CapturOutput
) => void;
capturDidGenerateError?: (capturError: CapturError) => void;
capturDidGenerateGuidance?: (metadata: CapturOutput) => void;
capturDidRevokeGuidance?: () => void;
}
endAttempt()
endAttempt(): Promise<void>
Ends the current verification attempt and triggers the SDK to return a final decision.
CapturCameraState
An enum representing the current state of the camera:
- INITIALIZING
- READY
- SCANNING
- PROCESSING
- DECISION_MADE
- ERROR
CapturOutput
An object containing metadata about the verification process:
interface CapturOutput {
decision?: string; // "goodDelivery", "badDelivery", "insufficientInformation"
decisionTitle?: string; // Title for the decision or guidance
decisionDetail?: string; // Details about the decision or guidance
guidanceDetail?: string; // Additional guidance information
imageDataBase64?: string; // Base64-encoded image data
// Additional fields may be present depending on the verification type
}
CapturError
An object containing error information:
interface CapturError {
code: string; // Error code
message: string; // Error message
details?: any; // Additional error details
}
Updated about 1 month ago