Init SDK

initialization

Initialize the SDK and returns the initialization result to the caller.

HardwareSDK.init(params);

Params

  • debug - optional boolean print debug log option

  • fetchConfig- optional boolean Allows querying for updated device version information over the network, used for prompting device updates and informing which version is needed for older hardware to use new features.

  • env - optional 'webusb' | 'react-native' | 'lowlevel' the environment to use the SDK

    • 'webusb' - Use WebUSB protocol for direct browser-to-device USB communication (requires HTTPS)

    • 'react-native' - Use for React Native applications with Bluetooth

    • 'lowlevel' - Use for custom low-level transport implementations

Example

Web with WebUSB:

HardwareSDK.init({
    debug: false,
    fetchConfig: true,
    env: 'webusb', // Use WebUSB for direct USB communication
});

React Native:

HardwareSDK.init({
    debug: false,
    fetchConfig: true,
    env: 'react-native',
});

Last updated

Was this helpful?