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

trustid-sdk

v1.1.11

Published

[![npm version](https://img.shields.io/npm/v/trustid-sdk?color=blue)](https://www.npmjs.com/package/trustid-sdk) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Readme

🔐 TrustId SDK

npm version License: MIT

A JavaScript SDK to connect with the TrustId browser extension, perform KYC checks, create/import wallets using Bech32, and interact with the TrustId blockchain.


✨ Features

  • 🔗 Connect with TrustId browser extension
  • 🧾 Request user KYC data
  • 🔐 Retrieve secure access tokens
  • 💳 Create/Import wallets with Bech32 (trust prefix)
  • 🧬 Register and verify KYC data on the TrustId chain
  • 📦 Sign and send transactions
  • 🔍 Fetch block, transaction, and account data

📦 Installation

npm install trustid-sdk

🚀 Quick Start

1. Initialize SDK

import TrustIdSDK from "trustid-sdk";

const trustId = new TrustIdSDK({
  apiKey: "YOUR_API_KEY",
  apiUrl: "https://your-backend.com",
});

2. Connect to TrustId Extension

await trustId.connect();

if (trustId.isConnected) {
  console.log("Connected to TrustId");
}
3. Get KYC Data

const kycResult = await trustId.getKYCData();
console.log(kycResult);
4. Get Access Token

const tokenResult = await trustId.getAccessToken();
console.log(tokenResult);
💳 Wallet Management (Bech32)
Create New Wallet

const wallet = await trustId.createWallet();
console.log(wallet);
/*
{
  mnemonic,
  privateKey,
  publicKey,
  address,
}
*/
Import Wallet (Mnemonic or Private Key)

// Use either mnemonic or private key

const wallet = await trustId.importWallet("your mnemonic or privateKey");
console.log(wallet);

🧾 Chain Actions (TrustId Chain)

Method	Description

createWallet()	Create wallet using Bech32 address (prefix: trust)
importWallet()	Import wallet using private key or mnemonic
registerWallet()	Register KYC data on-chain with the wallet
verifyRegister()	Verify wallet-KYC connection
getUserInfo()	Get user info via extension or gRPC
getTransactions()	Get all transactions from a given block number
getTransactionInfo()	Get transaction detail using hash
getCurrentBlock()	Get latest block number
signTransaction()	Sign transaction with private key
personal.sign()	Sign data without exposing private key
sendTransaction()	Broadcast signed transaction to the chain
account()	Get full account info (balances, etc.)

🧪 React Usage Example

import React, { useEffect } from "react";
import TrustIdSDK from "trustid-sdk";

const trustId = new TrustIdSDK({
  apiKey: "YOUR_API_KEY",
  apiUrl: "https://your-backend.com",
});

export default function WalletConnect() {
  useEffect(() => {
    trustId.connect().then(() => {
      if (trustId.isConnected) console.log("Connected to TrustId");
    });
  }, []);

  const createWallet = async () => {
    const wallet = await trustId.createWallet();
    console.log(wallet);
  };

  return (
    <button onClick={createWallet}>Create Wallet</button>
  );
}
🛡️ Error Handling
Use try/catch with all SDK calls:


try {
  const wallet = await trustId.createWallet();
} catch (err) {
  console.error("Wallet creation failed:", err.message);
}
📄 License
MIT

🙋 Support
For bugs, suggestions, or contributions, open an issue on GitHub or contact the maintainers.

🔢 Error Code Format
Based on character positions of trustid:

t=20, r=18, u=21, s=19, t=20, i=9, d=4 → 201821192094

Last 3 digits represent action:

Wallet Creation: 201821192094-233

Wallet Import: 201821192094-239

🧼 Deprecated Features (Removed)
The following features were present in older versions and have been removed:

Camera detection

Face detection and liveness check

Face-based login using face-api.js

You can now:

1. **Replace your existing `README.md`** with the content above.
2. Run `npm version patch` or `npm version minor` depending on your change.
3. Run `npm publish` to upload the new version of your SDK.

Let me know if you want to include a `CHANGELOG.md` or auto-generate GitHub documentation pages.