HaLo
Using libHaLo

libHaLo

Overview

LibHaLo is an open library designed for interacting with HaLo chips from a variety of interfaces including a mobile web browser, native apps and CLIs. Below you can find guides from the libHaLo repo that include detailed examples on how you can use libHaLo in your project. We recommend looking at the Guides section to find the right guide for your use case. Below we've included a common mobile web example to get you started quickly.

Demos

We host several interactive libHaLo demos (opens in a new tab) that you can try out in your mobile web and desktop browser as indicated.

Example

Mobile Browser Example

Include the libhalo.js on your webpage:

<script src="libhalo.js"></script>

Create a minimal user interface:

<div id="statusText">Please click on the button below.</div>
<button onclick="btnPressed();">Click here</button>

Call the library inside the button click routine:

async function btnPressed() {
    let command = {
        name: "sign",
        keyNo: 1,
        digest: "6e76e202b71892e9ee32a634eefcf522ba1c4cb4eadd7e4562ced1270214c41e"
    };
    
    document.getElementById('statusText').innerText = "Please tap NFC tag to the back of your smartphone...";
 
    try {
        let res = await execHaloCmdWeb(command);
        // display operation result
        document.getElementById('statusText').innerText = JSON.stringify(res, null, 4);
    } catch (e) {
        // display error
        document.getElementById('statusText').innerText = e;
    }
}

Load the webpage through HTTPS on a mobile browser like iOS Safari or Android Chrome and tap Click here to initiate a scan. You can use a tool like localtunnel (opens in a new tab) to serve a locally hosted page over HTTPS.

Guides

For web browser applications: scan the HaLo tag presented to the smartphone, execute the HaLo command and return the result. Supports Chrome (Android), Safari (iOS) and other browsers. Installation of additional software is not required on the user's side.

(React Native/Expo) execHaloCmdRN

async function execHaloCmdRN(nfcManager, command, options)

For React Native/Expo mobile applications (Android/iOS) based on react-native-nfc-manager library: scan the HaLo tag presented to the smartphone, execute the HaLo command and return the result.

(Desktop) execHaloCmdPCSC

async function execHaloCmdPCSC(command, reader)

For desktop applications based on nfc-pcsc library: scan the HaLo tag present at the specified reader, execute the HaLo command and return the result.

Commands

LibHaLo library supports the following HaLo tag commands:

  • sign - sign arbitrary data using ECDSA private key on the NFC tag;
  • sign_random - sign a sequential counter with random pad using ECDSA private key on the NFC tag;
  • sign_challenge - sign a specified challenge using selected key slot on the NFC tag;
  • write_latch - write one-time programmable memory slot on the NFC tag;
  • cfg_ndef - configure the parameters returned in the dynamic URL when the NFC tag is scanned;
  • gen_key - request generation of the key;
  • gen_key_confirm - confirm the generated public key;
  • gen_key_finalize - finish the key generation process;
  • get_pkeys - get tag's public keys #1, #2 and #3;
  • get_key_info - get information about the specified key slot;
  • version - check HaLo tag's firmware version (only for PCSC/React Native);
  • read_ndef - read the dynamic URL generated by the tag (only for PCSC/React Native);

Full articles:

Last updated on August 26, 2025