@hovi/core-sdk
v0.2.0
Published
TypeScript SDK for Hovi Core
Readme
Hovi Core SDK
Build cross-ecosystem verifiable credential flows, effortlessly
Hovi Core SDK is a TypeScript library that streamlines decentralized identity workflows across multiple ecosystems (OpenID, Indicio, Cheqd, Privado). Whether you're issuing credentials, managing DIDComm connections, or verifying proofs, the SDK provides methods for different credential formats like JSON-LD, Anoncreds, SD-JWT, and mDoc.
Table of Contents
Installation
# Using npm
npm install @hovi/core-sdk
# Using Yarn
yarn add @hovi/core-sdkHow to Get an API Key
To use the Core SDK, you’ll need an API key.
You can generate one from the Hovi Dashboard
Quick Start
import {
OpenIdEcosystem,
IndicioEcosystem,
CheqdEcosystem,
PrivadoEcosystem,
} from "@hovi/core-sdk";
const openid = new OpenIdEcosystem({ apiKey: "your-openid-api-key" });
const indicio = new IndicioEcosystem({ apiKey: "your-indicio-api-key" });
const cheqd = new CheqdEcosystem({ apiKey: "your-cheqd-api-key" });
const privado = new PrivadoEcosystem({ apiKey: "your-privado-api-key" });Usage
The SDK provides simple methods for managing tenants, establishing connections, issuing credentials, and verifying proofs.
Tenant Management
Creates a new tenant in the Hovi ecosystem, which is required for managing credentials, verifications, and related operations
// Create a new tenant
const tenant = await openid.createTenant({
tenantName: "your-tenant-name",
tenantLabel: "tenant-label",
tenantSecret: "secret1243",
imageUrl: "https://example.com/logo.png",
});
// Get all tenants
const tenants = await openid.getAllTenants();Connections
Manage secure interactions between tenants and external wallets through connection endpoints.
// Create a connection invitation
const invitation = await cheqd.createConnectionInvitation({
tenantId: "your-tenant-id",
label: "connection-name",
});
// List connections
const connections = await cheqd.getConnections({
tenantId: "your-tenant-id",
});Credential Issuance
Create reusable credential templates and issue verifiable credentials from them.
// Create a SD-JWT credential template
const credTemplate = await openid.createCredentialTemplateSdJwt({
tenantId: "your-tenant-id",
name: "Employee ID Card",
version: "1.0.0",
description: "Template for issuing employee ID credentials",
schemaType: "EmployeeSchema",
attributes: [
{
name: "firstName",
label: "First Name",
type: "string",
description: "The employee's given name",
required: true,
},
{
name: "lastName",
label: "Last Name",
type: "string",
description: "The employee's family name",
required: true,
},
],
});
// Offer a SD-JWT credential
const offer = await openid.offerCredentialSdJwt({
tenantId: "your-tenant-id",
credentialTemplateId: "your-credential-template-id",
credentialValues: {
firstName: "Alice",
lastName: "Johnson",
},
});Credential Verification
Use verification templates to request and verify credentials.
// Create a verification template
const vTemplate = await openid.createVerificationTemplateSdJwt({
tenantId: "your-tenant-id",
name: "Employee Verification",
version: "1.0.0", // 0.0.0 format required
description: "Template for verifying employee identity",
requestedAttributes: [
{
name: "firstName",
label: "First Name",
type: "string",
description: "The employee's given name",
required: true,
},
{
name: "lastName",
label: "Last Name",
type: "string",
description: "The employee's family name",
required: true,
},
],
});
// send verification proof requests
const proofRequest = await openid.sendProofRequest({
tenantId: "your-tenant-id",
verificationTemplateId: "your-verification-template-id";
})
SDK Documentation
Detailed docs are available at Documentation.
