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

react-native-mfa-trustbuilder

v0.3.1

Published

Trustbuilder MFA SDK for React Native

Readme

react-native-mfa-trustbuilder

Trustbuilder MFA SDK for React Native. Provides multi-factor authentication capabilities including activation, OTP generation, biometric authentication, push notifications, and transaction sealing.

Installation

npm install react-native-mfa-trustbuilder

iOS

cd ios && pod install

Android

No additional steps required.

Usage

import { trustbuilder, TrustbuilderError } from 'react-native-mfa-trustbuilder';

// Initialize (call once at app startup)
const result = trustbuilder.initialize({
  macId: 'your_maccess_id',
  server: 'https://www.myinwebo.com',
  hostVersion: 'my-app-1.0.0',
});

// Restore saved state
const storedData = trustbuilder.getStorageData();
if (storedData) {
  trustbuilder.setStorageData(storedData);
}

// Check activation status
if (trustbuilder.isActivated()) {
  // Generate online OTP
  const { otp, remainingTime } = await trustbuilder.generateOnlineOtp('1234');
}

API Reference

Initialization

initialize(config: InitConfig): InitResult

Initialize the Trustbuilder SDK.

trustbuilder.initialize({
  macId: 'your_maccess_id', // Required
  server: 'https://www.myinwebo.com', // Default
  hostVersion: 'my-app-1.0.0', // Default: 'react-native-mfa-trustbuilder-0.1.0'
  timeout: 60000, // Default: 60000ms
  lang: 'en', // 'en' | 'fr', Default: 'en'
});

Activation

activationStart(code: string): Promise<void>

Start the device activation process.

activationFinalize(code: string, pin: string, name: string): Promise<void>

Finalize device activation.

activate(code: string, pin: string, name: string): Promise<void>

Convenience method that calls both start and finalize.

Unlock / Reset

reset(code: string, pin: string): Promise<void>

Unlock a blocked device with an unlock code.

Synchronization

synchronize(pin: string): Promise<void>

Synchronize device state with Trustbuilder servers.

PIN Management

updatePin(newPin: string, currentPin: string): Promise<void>

Update the user's PIN code.

Biometrics

registerBiokey(biokey: string, pin: string): Promise<void>

Register a biometric key.

resetBiokeys(pin: string): Promise<void>

Reset all registered biometric keys.

OTP Generation

generateOnlineOtp(pin: string, serviceIndex?: number, keyType?: KeyType): Promise<OtpResult>

Generate an OTP via server call.

generateOfflineOtp(pin: string, serviceId?: number): Promise<OtpResult>

Generate an OTP locally without network.

Push Notifications

registerForPush(pushId: string): Promise<void>

Register device for push notifications.

getPushInfo(): PushInfo | null

Check for pending push notification.

onPushReceived(listener: (pushInfo: PushInfo) => void): () => void

Subscribe to push notification events.

Sealing

generateOnlineSeal(pin: string, sealData: string, serviceIndex?: number, keyType?: KeyType): Promise<SealResult>

Generate an online seal.

generateOfflineSeal(pin: string, sealData: string, serviceId?: number): Promise<SealResult>

Generate an offline seal.

Utility

isActivated(): boolean

Check if device is activated.

isBlocked(): boolean

Check if device is blocked.

getServiceInfo(index?: number): ServiceInfo

Get service information.

getVersionInfo(): VersionInfo

Get SDK version information.

saveStorageIfNeeded(): void

Save internal state if it has changed. Call after each operation.

Error Handling

All methods throw TrustbuilderError on failure:

try {
  await trustbuilder.generateOnlineOtp('1234');
} catch (error) {
  if (error instanceof TrustbuilderError) {
    console.log(error.code); // Numeric error code
    console.log(error.codeName); // e.g., 'NETWORK', 'CODE', 'ACCESS'
    console.log(error.message); // Human-readable message
  }
}

Error Codes

| Code | Name | Description | | ---- | -------------- | ---------------------------------- | | 0 | OK | No error | | 1 | NETWORK | Network or server unreachable | | 2 | CODE | Activation code is incorrect | | 3 | SN | Syntax error | | 4 | ACCESS | Access refused | | 5 | VERSION | Version error | | 7 | BLOCKED | Account is blocked | | 14 | FORBIDDEN | Forbidden operation | | 15 | PINREFUSED | Bad PIN format | | 16 | TIMEOUT | Timeout expired | | 26 | BIOKEY | Device locked due to biokey errors | | 27 | DESYNCHRONIZED | Device desynchronized | | 999 | OTHER | Unknown error |

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT