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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@trust0/identus-react

v0.0.136

Published

React components for Hyperledger Identus, easily build your Identity applications on Cardano

Readme

A comprehensive React library for building Self-Sovereign Identity (SSI) applications with Hyperledger Identus SDK. This library provides React components, hooks, and providers for rapid integration of decentralized identity functionality into your React applications.

🚀 Features

🎯 Core Identity Features

  • DID Management - Create and manage Prism DIDs (blockchain-anchored) and Peer DIDs (ephemeral)
  • Credential Operations - Issue, hold, and verify credentials with full W3C standards compliance
  • DIDComm Messaging - Secure peer-to-peer messaging with automatic encryption
  • Connection Management - Establish and manage secure connections between identity agents

🛠️ Developer Experience

  • Pre-configured Providers - Ready-to-use React context providers for all identity operations
  • Comprehensive Hooks - Easy-to-use hooks for accessing identity functionality
  • Database Integration - Built-in encrypted storage with RIDB for credential and DID management
  • TypeScript Support - Full TypeScript definitions for type-safe development

🔧 Advanced Features

  • Multi-storage Support - IndexedDB, memory, and custom storage backends
  • Custom DID Resolvers - Extensible DID resolution with custom resolver support
  • Mediator Integration - Built-in mediator support for reliable message delivery
  • Backup & Recovery - Comprehensive backup and restore functionality

📦 Installation

npm install @trust0/identus-react @hyperledger/identus-sdk
yarn add @trust0/identus-react @hyperledger/identus-sdk

🏁 Quick Start

1. Basic Setup

Wrap your app with the AgentProvider to enable all identity functionality:

import React from 'react';
import { AgentProvider } from '@trust0/identus-react';

function App() {
  return (
    <AgentProvider>
      <YourApp />
    </AgentProvider>
  );
}

2. Initialize the Agent

import { useAgent, useDatabase } from '@trust0/identus-react/hooks';
import { StorageType } from '@trust0/ridb';

function IdentityWallet() {
  const { agent, start, stop, state } = useAgent();
  const { start: startDB, setSeed, setMediator } = useDatabase();

  const initializeWallet = async () => {
    // Initialize database
    await startDB({
      name: 'my-identity-wallet',
      storageType: StorageType.IndexDB,
      schemas: schemas
    });

    // Set wallet seed (generate or import)
    await setSeed(SDK.Domain.Seed.fromString('your-seed-here'));
    
    // Set mediator for message delivery
    await setMediator(SDK.Domain.DID.fromString('did:peer:mediator-did'));

    // Start the agent
    await start();
  };

  return (
    <div>
      <h2>Identity Wallet</h2>
      <p>Status: {state}</p>
      
      {state === 'stopped' && (
        <button onClick={initializeWallet}>
          Initialize Wallet
        </button>
      )}
      
      {state === 'running' && (
        <button onClick={stop}>
          Stop Agent
        </button>
      )}
    </div>
  );
}

3. Create and Manage DIDs

import { usePrismDID, usePeerDID } from '@trust0/identus-react/hooks';

function DIDManager() {
  const { prismDID, create: createPrismDID } = usePrismDID();
  const { peerDID, create: createPeerDID } = usePeerDID();

  return (
    <div>
      <h3>DID Management</h3>
      
      {/* Prism DID (Blockchain-anchored) */}
      <div>
        <h4>Prism DID</h4>
        {prismDID ? (
          <p>DID: {prismDID.toString()}</p>
        ) : (
          <button onClick={() => createPrismDID('main-identity')}>
            Create Prism DID
          </button>
        )}
      </div>

      {/* Peer DID (Ephemeral) */}
      <div>
        <h4>Peer DID</h4>
        {peerDID ? (
          <p>DID: {peerDID.toString()}</p>
        ) : (
          <button onClick={createPeerDID}>
            Create Peer DID
          </button>
        )}
      </div>
    </div>
  );
}

🎛️ Core Concepts

Hook Categories

| Category | Hooks | Purpose | |----------|--------|---------| | Core | useAgent, useApollo, useCastor, usePluto | SDK core components | | DID | usePrismDID, usePeerDID | DID creation and management | | Credentials | useIssuer, useHolder, useVerifier | Credential lifecycle | | Communication | useMessages, useConnections | DIDComm messaging | | Data | useDatabase, useCredentials | Storage and retrieval |