API Reference — React Native
SDK-Only Access
To ensure your integration remains stable and supported, always use the official SDKs. The underlying API endpoints are internal implementation details that may change in purpose, functionality, or be removed at any time without notice. Direct API access is not supported. Learn more →
The SDK methods documented here are your supported interface. Versioning is managed through SDK upgrades.
createVerifierSDK(config)
Creates and returns a VerifierSDK instance. Same configuration as the web SDK.
import { createVerifierSDK } from '@vecu/verifier-react-native-sdk';
const sdk = createVerifierSDK({
stage: 'production',
bearerToken: 'your-token',
});
Configuration
stage'development' | 'sandbox' | 'production'requiredDeployment stage. Determines the backend URL.
bearerTokenstringrequiredVECU API authentication token.
apiBaseUrlstringOverride the default endpoint for the selected stage.
polling.intervalMsnumberMilliseconds between status checks.
polling.timeoutMsnumberMaximum wait time (5 minutes).
polling.maxRetriesnumberConsecutive errors before stopping.
logLevel'debug' | 'info' | 'warn' | 'error' | 'none'Logging verbosity.
The SDK automatically resolves the correct endpoint for each stage. The apiBaseUrl property is available for local mock server testing only.
Components
VerificationView
Full verification flow component. Handles loading, QR display, polling, and all result states.
<VerificationView
sdk={sdk}
vin='1HGBH41JXMN109186'
hostHandlesResults={true}
onApproved={result => {
/* VerificationApproved */
}}
onDenied={result => {
/* VerificationDenied */
}}
onExpired={result => {
/* VerificationExpired */
}}
onError={error => {
/* VerifierError */
}}
style={{ flex: 1 }}
/>
sdkVerifierSDKrequiredSDK instance from createVerifierSDK().
vinstringrequiredVehicle Identification Number to verify.
onApproved(result: VerificationApproved) => voidRecommended host-app integration point for successful verification. This is
a plain callback function prop passed into VerificationView.
onDenied(result: VerificationDenied) => voidRecommended host-app integration point when verification is denied.
onExpired(result: VerificationExpired) => voidRecommended host-app integration point when the session expires.
onError(error: VerifierError) => voidCalled on any error.
onCancel() => voidCalled when the user cancels the verification screen.
proximityProximityConfigOptional GPS proximity verification. Device coordinates are retrieved
automatically via platform location services. If location permission is
denied, result will be unchecked.
enableNfcDeliverybooleanEnables Android NFC Host Card Emulation while the QR request is active, so a
wallet app can receive the presentation request via NFC instead of scanning
the QR. Requires react-native-hce and Android HCE native configuration
with the VECU AID F056454355000001.
screenFocusedbooleanPass useIsFocused() from React Navigation so the SDK can pause NFC
delivery when the screen is not active.
hostHandlesResultsbooleanWhen false, VerificationView renders the built-in approved, denied, and
expired screens. When true, the SDK still runs the verification flow and
still invokes onApproved, onDenied, and onExpired, but the host app is
expected to render its own terminal result screens.
styleStyleProp<ViewStyle>Container style.
When you use VerificationView, prefer these callback props as the app-facing integration boundary. Internally, the component listens to SDK status updates and invokes the callbacks when terminal states arrive.
Hooks
useVerifierSDK(config)
Creates an SDK instance tied to the component lifecycle. Automatically destroys on unmount.
import { useVerifierSDK } from '@vecu/verifier-react-native-sdk';
const sdk = useVerifierSDK({
stage: 'production',
bearerToken: token,
});
Core SDK Methods
createPresentationRequest(vin, options?)
const result = await sdk.createPresentationRequest('1HGBH41JXMN109186', {
proximity: { thresholdMiles: 5.0 },
});
if (result.ok) {
const { request_id, qr_content, expires_at } = result.data;
}
startPolling()
Starts polling for verification status. Stops automatically on terminal states.
Returns: () => void — cleanup function to stop polling.
stopPolling()
Manually stop polling.
getStatus() / getRequest()
Get current verification status or full request state.
destroy()
Clean up all resources.
Verification Status Types
All statuses share a common shape with requestId, createdAt?, and expiresAt?:
// Pending — waiting for driver to scan
{ status: 'pending', requestId: string, createdAt?: string, expiresAt?: string }
// Approved — credential verified, OK to release vehicle
{
status: 'approved',
requestId: string,
createdAt?: string,
expiresAt?: string,
verifiedClaims?: { vin: string, originLocation?: string, destinationLocation?: string },
proximityCheck?: { status: 'pass' | 'fail' | 'unchecked', distanceMiles, thresholdMiles, ... },
}
// Denied — DO NOT release vehicle
{ status: 'denied', requestId: string, createdAt?: string, expiresAt?: string, error?: string }
// Expired — session timed out
{ status: 'expired', requestId: string, createdAt?: string, expiresAt?: string }
Type guards: isApproved(status), isDenied(status), isTerminalStatus(status)
Proximity Types
ProximityConfig
Device GPS coordinates are retrieved automatically via platform location services. If location permission is not granted, the proximity check result will be unchecked.
interface ProximityConfig {
thresholdMiles: number; // Max allowed distance from origin (miles)
}
ProximityCheck
Returned on VerificationApproved.proximityCheck:
| Status | UI Behavior |
|---|---|
pass | Green "Proximity Verified" badge |
fail | Amber "Verified with Warning" card with distance |
unchecked | Location permission denied or not configured — neutral badge |
Error Types
| Code | Extra Fields |
|---|---|
NETWORK_ERROR | cause? |
API_ERROR | statusCode, details? |
VALIDATION_ERROR | field? |
TIMEOUT_ERROR | timeoutMs |
SESSION_ERROR | sessionId? |
All errors include code, message, and timestamp. Use isVerifierError() type guard.
Error Factory Functions
Helper functions for creating typed errors:
import {
createNetworkError,
createApiError,
createValidationError,
createTimeoutError,
createSessionError,
isVerifierError,
} from '@vecu/verifier-react-native-sdk';