Skip to main content

Constants Reference

The SDK provides various constants for configuration. Access them using getConstants().

const constants = AilaSDK.getConstants();

Code Types

Enable or disable specific barcode symbologies using these constants with codesConfiguration.

AilaCodeType = {
AilaCodeTypeNone: number; // Disable all code types
AilaCodeTypeAztec: number; // Aztec codes
AilaCodeType2of5: number; // 2 of 5 codes and variants
AilaCodeTypeCodaBar: number; // CodaBar codes
AilaCodeType39: number; // Code 39
AilaCodeType93: number; // Code 93
AilaCodeType128: number; // Code 128 and variants
AilaCodeTypeDataMatrix: number; // DataMatrix codes
AilaCodeTypeEAN: number; // EAN codes and variants
AilaCodeTypeDataBar: number; // GS1 DataBar codes
AilaCodeTypeMRZ: number; // MRZ strings
AilaCodeTypeMSIPlessey: number; // MSI/Plessey codes
AilaCodeTypePDF417: number; // PDF417 codes
AilaCodeTypeUPC: number; // UPC codes and variants
AilaCodeTypeQR: number; // QR codes
}

Example:

const { AilaCodeType } = AilaSDK.getConstants();

await AilaSDK.init({
codesConfiguration: [
AilaCodeType.AilaCodeTypeQR,
AilaCodeType.AilaCodeType128,
AilaCodeType.AilaCodeTypeUPC
]
});

Multi-Scan Mode

Control whether multiple barcodes can be scanned in a single session.

multiScanMode = {
AilaMultiScanModeOff: 0; // Single scan mode
AilaMultiScanModeOn: 1; // Enable multi-scan
}

Default: AilaMultiScanModeOff

When enabled, the SDK can capture multiple barcodes and return them as a stream. Useful for scanning multiple items or finding specific barcodes among many.

Duplicate Filter

Control duplicate detection in multi-scan mode.

duplicateFilter = {
AilaDuplicateFilterOff: 0; // Return all scans
AilaDuplicateFilterOn: 1; // Filter duplicates
}

Default: AilaDuplicateFilterOn

When enabled (and multi-scan mode is active), each barcode is returned only once per session until timeout (4s with no motion) or resetScan() is called.

Beep Mode

Control automatic beep feedback on successful scans.

beepMode = {
AilaBeepModeOff: 0; // No automatic beep
AilaBeepModeOn: 1; // Beep on scan
}

Default: AilaBeepModeOn

Note: When multi-scan mode is enabled, automatic beeping is disabled. Use beep() to manually trigger feedback.

Focus Mode

Select the camera focus algorithm.

focusMode = {
AilaStandardFocusMode: 0; // Normal focus algorithm
AilaSafeFocusMode: 1; // Sweep focus with reduced lighting
}

Default: AilaStandardFocusMode

Safe focus mode should only be used in special situations when standard focus is not responsive.

MRZ Mode

Enable or disable MRZ scanning.

mrzMode = {
AilaMRZModeOff: 0; // Disable MRZ scanning
AilaMRZModeOn: 1; // Enable MRZ scanning
}

Default: AilaMRZModeOff

When enabled, kiosk lighting is automatically disabled as it interferes with MRZ scanning.

MRZ Detection Mode

Enable early MRZ component detection for UI feedback.

mrzDetectionMode = {
AilaMRZDetectionModeOff: 0; // No early detection
AilaMRZDetectionModeOn: 1; // Detect MRZ components
}

Default: AilaMRZDetectionModeOff

Posts onMRZDetected events when MRZ components are detected, before complete scanning.

GS1 Parsing Mode

Control GS1 Application Identifier formatting.

gs1ParsingMode = {
AilaGS1ParsingModeOff: 0; // Raw string
AilaGS1ParsingModeOn: 1; // Parse with AIs in parentheses
}

Default: AilaGS1ParsingModeOff

When enabled, GS1 codes are returned with Application Identifiers in parentheses for easier parsing.

Driver's License Parsing Mode

Enable structured parsing of US driver's license barcodes.

dlParsingMode = {
AilaDLParsingModeOff: 0; // Return raw PDF417 data
AilaDLParsingModeOn: 1; // Parse driver's license data
}

Default: AilaDLParsingModeOff

When enabled, PDF417 codes on US driver's licenses are parsed into structured JSON data.

UPC-E Expansion Mode

Control UPC-E to UPC-A conversion.

upceExpansionMode = {
AilaUPCEExpansionModeOff: 0; // Return UPC-E as-is
AilaUPCEExpansionModeOn: 1; // Expand to UPC-A format
}

Default: AilaUPCEExpansionModeOff

ID-1 Card Detection Mode

Enable automatic detection of ID-1 sized cards in the tray.

id1CardDetectionMode = {
AilaID1CardDetectionModeOff: 0; // No detection
AilaID1CardDetectionModeOn: 1; // Detect cards
}

Default: AilaID1CardDetectionModeOff

When enabled, onId1CardDetected events are fired when a card is placed in the ID tray. Only compatible with Interactive Kiosks fitted with an ID Tray.

Image Capture Debug Mode

Control image return behavior on capture timeout.

imageCaptureDebugMode = {
AilaImageCaptureDebugModeOff: 0; // No images on timeout
AilaImageCaptureDebugModeOn: 1; // Return images with error code
}

Default: AilaImageCaptureDebugModeOff

When enabled, failed capture attempts return the image with a watermarked error code for debugging.

Camera Position

Select which camera to use for scanning.

enabledCameraPosition = {
AilaEnabledCameraPositionBack: 0; // Rear camera
AilaEnabledCameraPositionFront: 1; // Front camera
}

Default: AilaEnabledCameraPositionBack

Currently only supports barcode scanning through the front camera.

Cloud Licensing

Enable automatic license updates from Aila's cloud service.

cloudLicensing = {
AilaCloudLicensingOff: 0; // Disable cloud updates
AilaCloudLicensingOn: 1; // Enable cloud updates
}

Default: AilaCloudLicensingOff

When enabled, the SDK automatically retrieves and applies license updates.

Remote Status Monitoring (RSM)

Enable device health and performance monitoring.

rsm = {
AilaRSMOff: 0; // Disable monitoring
AilaRSMOn: 1; // Enable monitoring
}

Default: AilaRSMOn

Allows Aila to monitor system health, performance, and provide enhanced customer support.

Power Management Mode

Enable automatic power optimization.

powerManagementMode = {
AilaPowerManagementModeOff: 0; // No power management
AilaPowerManagementModeOn: 1; // Enable power optimization
}

Default: AilaPowerManagementModeOn

When enabled:

  • Efficiency Mode: Reduces screen brightness to 90% for cooler 24/7 operation
  • Safe Mode: Optimizes settings during power deficiencies to keep the system online

Debug Level

Control SDK logging verbosity.

debugLevel = {
AilaDebugLevelSilent: 0; // No messages
AilaDebugLevelError: 1; // Error messages only
AilaDebugLevelWarn: 2; // Warnings and errors
AilaDebugLevelInfo: 3; // Informational messages
AilaDebugLevelDebug: 4; // Internal debugging
AilaDebugLevelBulk: 5; // High-volume low-level messages
}

Default: AilaDebugLevelWarn

Each level includes messages of equal or greater severity. Debug and Bulk levels may have no effect in release versions.

Hardware Class

Values returned by getHardwareClass():

hardwareClass = {
AilaHardwareClassNone: 0; // No hardware connected
AilaHardwareClassKiosk: 1; // Interactive Kiosk
AilaHardwareClassMobile: 2; // Mobile Imager (legacy)
}

Connection Info

Values returned by getConnectionInfo():

  • "Not Available" - No Aila hardware connected
  • "Digital" - USB-C connection
  • "Analog" - Lightning connection (normal operation)
  • "Analog (problem)" - Lightning connection issue