npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

zimra-fdms-react-native

v0.4.0-beta.1

Published

Android adapter for zimra-fdms: device key in Android Keystore, mutual TLS through OkHttp, fiscal core on Hermes

Readme

zimra-fdms-react-native

Android adapter for zimra-fdms. The device key is created inside Android Keystore (StrongBox where the phone has one) with PURPOSE_SIGN only, so it cannot be exported, copied to another phone or read by a rooted process. The same key signs receipts and authenticates the mutual-TLS connection to FDMS.

Everything fiscal runs in zimra-fdms/core on Hermes: canonical strings, SHA-256, MD5 for the QR checksum, counters and the hash chain. The native module does three things: generate and hold the key, sign bytes, and run HTTPS with the key as the client identity.

Install

npm install zimra-fdms zimra-fdms-react-native

Autolinking picks up the Android module. Expo managed projects need a development build; the module does not run in Expo Go. Android 8 (API 26) or later.

Register once

import { KeystoreSigner, registerDevice } from "zimra-fdms-react-native";

const signer = await KeystoreSigner.ensure("zimra-device-12345");
const { certificatePem } = await registerDevice(
  { deviceId: 12345, serialNumber: "MYPOS001", modelName: "Android", modelVersion: "1" },
  "ACTIVKEY",
  signer,
  { environment: "test" },
);
// Persist certificatePem (it is public). The key stays in the keystore.

Every day

import { createFiscalDevice } from "zimra-fdms-react-native";

const device = createFiscalDevice(
  { deviceId: 12345, serialNumber: "MYPOS001", modelName: "Android", modelVersion: "1" },
  { alias: "zimra-device-12345", certificatePem },
  { environment: "test" },
);

await device.openDay();
const sale = await device.submitReceipt({ /* same ReceiptInput as Node */ });
await device.closeDay();

Persist device.getState() after each receipt and restoreState() on launch, exactly as on Node. Receipt dates come from a clock corrected by FDMS response headers, so a phone with a wrong clock still produces Green receipts.

Key attestation

signer.attestationChain() returns the attestation certificate chain as PEM. A bank or auditor can verify from it that the key is hardware-backed and which security level (TEE or StrongBox) holds it.

Status

The keystore and mutual-TLS logic has run on an Android 16 emulator: android/check is the same code in plain Java, built with the SDK tools alone, and scripts/android-check.sh drives the real TypeScript core through it against the simulator. Key generation in Android Keystore, a CSR built by the core and signed by the keystore, RegisterDevice, mutual TLS with the keystore key as client identity, two receipts, a lost answer settled by reconcile(), and a signed CloseDay all pass.

That run found one thing the docs do not tell you: a keystore key used for TLS client authentication needs DIGEST_NONE in its digests as well as SHA256, because Conscrypt signs the already-hashed transcript. Both the check app and the Kotlin module set it.

What has not happened yet is a Gradle build of the React Native module itself, which needs a network the machine that wrote this did not have. The Kotlin mirrors the Java line for line, but its first build in your app is still the first build.

Emulator check

# an emulator or device on adb, a JDK, the Android SDK
bash scripts/android-check.sh