Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する

API Reference


This section provides detailed documentation for the public classes, methods, and data schemas in the did-auth library. It's intended for developers who need to understand the library's components in-depth to build or customize DID authentication workflows.

The library's architecture is centered around two main classes: WalletAuthenticator for cryptographic operations and WalletHandlers for managing the HTTP-based authentication flow.

Core Component Interaction#

The following diagram illustrates how your application, did-auth components, and the DID Wallet interact during an authentication process.

DID WalletWalletAuthenticatorWalletHandlersYour ApplicationDID WalletWalletAuthenticatorWalletHandlersYour ApplicationInitialize auth (e.g., login request)Create and sign auth request (claims)Signed auth requestReturn deep link URL / QR code dataPresent QR code / deep linkUser scans and posts signed responseVerify wallet responseVerification result (success/fail)Notify application of auth result (e.g., via callback)

Key Components#

This reference is divided into the following sections:

  • WalletAuthenticator The WalletAuthenticator class is the core engine for creating, signing, and verifying authentication messages. It handles the cryptographic operations and ensures the integrity of the data exchanged between your application and the user's wallet. It does not handle HTTP transport or session management.
  • WalletHandlers The WalletHandlers class provides a set of Express.js middleware to manage the entire DID authentication lifecycle. It automates the creation of API endpoints for token generation, status checking, and handling responses from the wallet, simplifying integration into your web application.
  • Schemas This section details the validation schemas for appInfo, chainInfo, and all supported claim types. These schemas, built with Joi, ensure that the data structures passed to and from the wallet are correctly formatted. Use this reference to construct valid claim requests.


To see how these components are used in a practical scenario, you can proceed to the How-to Guides.