API Integration Tutorials
This guide walks through the end-to-end issuance and verification flows available in the Hovi API. We reference our TypeScript Examples Repository to demonstrate how to structure these requests in a real-world application.
Repository Access: All files referenced below can be found in the
Hovi API Examples Repository.
Project Setup
Follow these steps to get the example project running on your local machine.
-
Clone the Repository: Download the code to your local machine using git.
git clone https://github.com/hovi-id/hovi-api-examples.git
cd hovi-api-examples/typescript/api -
Install Dependencies: Install the necessary packages to run the scripts.
npm install -
Configure Environment: Create a
.envfile by copying the provided example. Open it and add yourAPI_KEYand the HoviBASE_URL(e.g.,https://api.hovi.id).cp .env.example .env -
Explore Shared Utilities: To keep our code clean and DRY (Don't Repeat Yourself), we use a centralized
utilsfolder for common actions.utils/tenant.ts: Handles the creation of the Tenant (Issuer).utils/templates.ts: Manages the creation of Credential and Verification templates.
General Lifecycle
Issuing a credential involves a specific sequence of steps to ensure trust and security. While protocols vary, the logical flow remains consistent.
-
Configure Issuer (Setup): Before anything else, you must define who is issuing the credential (the Tenant) and what data structure they are issuing (the Credential Template).
-
Establish Secure Connection (Ecosystem Dependent):
- For Cheqd, Indicio, PrivadoID: You cannot just send data to a user; you must first establish a private, encrypted communication channel. The user scans a "Connection Invitation" QR code to link their wallet to your issuer.
-
Offer Credential: The issuer generates a "Credential Offer." This is a digital package sent to the user (or presented as a QR code) saying, "I would like to give you this document."
-
Receive Credential: The user reviews the offer in their digital wallet and accepts it. The credential is now cryptographically stored on their device.
-
Verify Credential: To prove validity, the issuer (or a third-party verifier) sends a "Proof Request." The user selects the credential in their wallet and agrees to share the specific data requested.
Supported Ecosystems
Hovi is built on open standards to ensure your credentials work across different networks and wallets. We support a wide range of credential formats—including mDocs, SD-JWT, AnonCreds, and JSON-LD—allowing you to choose the right standard for your specific use case, whether it's government ID compliance or privacy-preserving age verification.
For a deep dive into how these standards work together, visit our Interoperability Guide.
OpenID
The OpenID flow utilizes the OID4VCI standard for immediate issuance.
| Credential Format | Description | Example Code |
|---|---|---|
| SD-JWT | Supports complex claims with selective disclosure capabilities. | See example |
| mDoc | Mobile-optimized credential format standardized by ISO. | See example |
| JSON-LD | Standard W3C credentials signed using JSON Web Signatures. | See example |
Cheqd
Cheqd is built on the Cosmos SDK and is optimized for commercial identity models and payment rails.
| Credential Format | Description | Example Code |
|---|---|---|
| JSON-LD | Standard W3C credentials with Cheqd network anchoring. | See example |
| Anoncreds | Privacy-preserving credentials supporting Zero-Knowledge Proofs (ZKP). | See example |
Indicio
Indicio is built on Hyperledger Indy, offering a robust network frequently used for enterprise and government identity solutions.
| Credential Format | Description | Example Code |
|---|---|---|
| Anoncreds | Privacy-preserving credentials supporting Zero-Knowledge Proofs (ZKP). | See example |
| JSON-LD | Standard W3C credentials with Indy network anchoring. | See example |
PrivadoID
PrivadoID focuses on native integration of Zero-Knowledge identity and privacy-by-design principles.
| Credential Format | Description | Example Code |
|---|---|---|
| JSON-LD | W3C credentials optimized for the Privado ecosystem. | See example |