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'required

Deployment stage. Determines the backend URL.

bearerTokenstringrequired

VECU API authentication token.

apiBaseUrlstring

Override the default endpoint for the selected stage.

polling.intervalMsnumber

Milliseconds between status checks.

polling.timeoutMsnumber

Maximum wait time (5 minutes).

polling.maxRetriesnumber

Consecutive 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 }}
/>
sdkVerifierSDKrequired

SDK instance from createVerifierSDK().

vinstringrequired

Vehicle Identification Number to verify.

onApproved(result: VerificationApproved) => void

Recommended host-app integration point for successful verification. This is a plain callback function prop passed into VerificationView.

onDenied(result: VerificationDenied) => void

Recommended host-app integration point when verification is denied.

onExpired(result: VerificationExpired) => void

Recommended host-app integration point when the session expires.

onError(error: VerifierError) => void

Called on any error.

onCancel() => void

Called when the user cancels the verification screen.

proximityProximityConfig

Optional GPS proximity verification. Device coordinates are retrieved automatically via platform location services. If location permission is denied, result will be unchecked.

enableNfcDeliveryboolean

Enables 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.

screenFocusedboolean

Pass useIsFocused() from React Navigation so the SDK can pause NFC delivery when the screen is not active.

hostHandlesResultsboolean

When 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:

StatusUI Behavior
passGreen "Proximity Verified" badge
failAmber "Verified with Warning" card with distance
uncheckedLocation permission denied or not configured — neutral badge

Error Types

CodeExtra Fields
NETWORK_ERRORcause?
API_ERRORstatusCode, details?
VALIDATION_ERRORfield?
TIMEOUT_ERRORtimeoutMs
SESSION_ERRORsessionId?

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';