This module facilitates seamless interaction with Tuvali's verifier module for BLE (Bluetooth Low Energy) transfers. It offers a user-friendly API tailored for the verifier App's convenience. Additionally, it maintains essential state data within its context, which the UI module can access and utilize effectively.
Also have React Hooks, Request Util and any other utilities that makes it easier for verifier to integrate.
npm install @mosip/ble-verifier-sdk
import OVP_BLE from "@mosip/ble-verifier-sdk";
import OVP_BLE_Verifier_UI from "mosip-react-native-ble-verifier-ui";
const instance = new OVP_BLE({deviceName: "simVerifier"});
const VPShare = ({onSuccess}) => {
useEffect(() => {
instance.startTransfer().then((data) => onSuccess(data));
})
return <OVPBLE_Verifier_UI instance={instance} theme={theme} />
}
Note: The mosip-react-native-ble-verifier-ui
module is yet to be build. If you want to implement your own UI screens, please look at the documentation for internal APIs.
Initialize the ovp-ble
module with the config provided
const instance = new OVP_BLE({deviceName: "simVerifier"});
deviceName
: This name is provided in the advertisment payload during the BLE advertisement. This field have a limit of11
characters.
This API starts the BLE transfer with the config provided. This method returns a Promise<String>
.
Promise resolves with the VC.
{ vc: string }
Note: Once the specification is completed, this will be returning VP instead.
Promise rejects with error code and error method.
{
errorCode: string;
errorMessage: string;
}
Most of the error code are coming from Tuvali. Some of them are from ovp-ble itself. Such as
OVP_001 --> 'Transfer stopped'
OVP_002 --> 'Device name length exceeded limit of 11 characters'
- Tuvali error codes
This API stops the BLE trasfer.
See the contributing guide to learn how to contribute to the repository and the development workflow.