OneKey Docs
Ask or search…
K
Comment on page

Install SDK

Installation

The support status for Bluetooth and USB on different devices.
Device
Bluetooth
USB
OneKey Classic
OneKey Mini
OneKey Touch
This is the platform we support.
Web
React Native
Nodejs / iOS Native / Android Native / Flutter
# Install via NPM
npm install --save @onekeyfe/hd-web-sdk
# Install via YARN
yarn add @onekeyfe/hd-web-sdk

Initialization

import { HardwareWebSdk as HardwareSDK } from '@onekeyfe/hd-web-sdk';
HardwareSDK.init({
debug: true,
fetchConfig: true,
connectSrc: 'https://jssdk.onekey.so/0.3.30/'
})
fetchConfig: 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.
connectSrc: The official web page deployed by OneKey is used to create an iframe on the page to communicate with OneKey Bridge.
The complete link to the web page is https://jssdk.onekey.so/0.3.30/iframe.html.
Normally, the number after the URL should match the version number of the SDK you installed. For example, “0.3.30” in this case.
If encountering issues with the web page failing to load for the corresponding version number, please try using a different version of the SDK or submit an issue on GitHub for feedback. We will work quickly to resolve the problem.
# Install via NPM
npm install --save @onekeyfe/hd-ble-sdk
# Install via YARN
yarn add @onekeyfe/hd-ble-sdk

Initialization

import { HardwareWebSdk as HardwareSDK } from '@onekeyfe/hd-ble-sdk';
HardwareSDK.init({
debug: true,
fetchConfig: true,
})
connectSrc: The official web page deployed by OneKey is used to create an iframe on the page to communicate with OneKey Bridge.
fetchConfig: 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.
Because our SDK is developed using the RN (React Native) and JS (JavaScript) technology stack. To avoid requiring everyone to depend on React Native, we adopt the following solution.
  • First, you need a container that can run JavaScript and communicate with it.
  • Prepare the JavaScript part of the code, and install @onekeyfe/hd-common-connect-sdk.
# Install via NPM
npm install --save @onekeyfe/hd-common-connect-sdk
# Install via YARN
yarn add @onekeyfe/hd-common-connect-sdk
Then, handle the part that communicates with the hardware device.
For specific platforms, how to integrate hd-common-connect-sdk, and demos for relevant platforms, please visit to learn more.
Next, you can return to the Quickstart and proceed with the steps for Configuring the Event.
Last modified 27d ago