npm package: @hovi/cloudwallet-sdk
Description: TypeScript SDK for Hovi Cloud Wallet
Latest version: 0.1.4

# ![Hovi SDK Logo](https://is1-ssl.mzstatic.com/image/thumb/Purple211/v4/62/ef/ab/62efab72-f110-39b6-ecd8-f1110652714c/AppIcon-0-0-1x_U007epad-0-1-85-220.png/1200x600wa.png)

# Hovi Cloud Wallet SDK

[![NPM Version](https://img.shields.io/npm/v/@hovi/cloudwallet-sdk?color=green&label=NPM)](https://www.npmjs.com/package/@hovi/cloudwallet-sdk) [![Build Status](https://img.shields.io/npm/dm/@hovi/cloudwallet-sdk.svg)](https://www.npmjs.com/package/@hovi/cloudwallet-sdk)

**Manage decentralized cloud wallets and verifiable credentials with ease**

Hovi Cloud Wallet SDK is a TypeScript library for creating and managing cloud-based decentralized wallets, handling verifiable credentials, processing proof requests, establishing connections, and integrating webhooks. With TypeScript support and a focus on privacy-preserving workflows, it enables secure identity solutions for applications like KYC verification, access control, and real-time event handling in decentralized ecosystems.

---

## Table of Contents

- [Installation](#installation)
- [Quick Start](#quick-start)
- [Usage](#usage)

  - [ Wallet Management](#wallet-management)
  - [ Connections](#connections)
  - [ Credential Management](#credential-management)
  - [ Verifiable Presentation](#verifiable-presentation)

- [API Reference](#api-reference)

---

## Installation

```bash
# Using npm
npm install @hovi/cloudwallet-sdk

# Using Yarn
yarn add @hovi/cloudwallet-sdk
```

---

## How to Get an API Key

To use the Cloud Wallet SDK, you’ll need an API key.  
You can generate one from the [Hovi Dashboard](https://studio.hovi.id/ecosystem/cloud-wallet)

---

## Quick Start

```ts
import { CloudWallet } from "@hovi/cloudwallet-sdk";

const wallet = new CloudWallet({
  apiKey: "your-cloud-wallet-ecosystem-api-key",
});
```

---

## Usage

### Wallet Management

Create and configure a cloud wallet for storing and managing verifiable credentials.

```ts
// Set wallet access token (required after creating or recovering a wallet)
await wallet.setWalletAccessToken("your-wallet-access-token");

// Create a wallet
const walletResponse = await wallet.createWallet({
  label: "your-wallet-name",
  secret: "secure-secret-123",
});
```

### Connections

Accept an out-of-band invitation to establish a secure wallet connection

```ts
// Accept connection invitation
const connectionResponse = await wallet.acceptConnectionInvitation({
  protocol: "didcomm",
  invitation:
    "https://example.com/invitation/123e4567-e89b-12d3-a456-426614174000",
  label: "your-connection-label",
});

// Get all connections
const connections = await wallet.getConnections();
```

### Credential Management

Manage credential offers by accepting or declining them (DIDComm/OpenID)

```ts
// Preview credential offer
const previewCredential = await wallet.previewCredentialOffer({
  protocol: "<didcomm | openid>",
});

// Accept credential offer
const acceptResponse = await wallet.acceptCredentialOffer({
  protocol: "<didcomm | openid>",
  credentialOfferUri:
    "https://example.com/offer/123e4567-e89b-12d3-a456-426614174000",
  credentialId: "your-credential-id",
});

// Get all stored credentials
const allStoredCredentials = await wallet.getStoredCredentials();
```

### Verifiable Presentation

Handle proof requests by previewing and submitting presentations (DIDComm/OpenID).

```ts
// Verifiable Presentation
const previewResponse = await wallet.previewProof({
  protocol: "<didcomm | openid>",
  proofRequestUri:
    "https://example.com/proof/123e4567-e89b-12d3-a456-426614174000",
  proofRecordId: "your-proof-record-id",
});

// Submit presentation
const submitResponse = await wallet.submitPresentation({
  protocol: "<didcomm | openid>",
  proofRequestUri:
    "https://example.com/proof/123e4567-e89b-12d3-a456-426614174000",
  proofRecordId: "your-proof-record-id",
});
```

---

## SDK Documentation

Detailed docs are available at [Documentation](https://docs.hovi.id/).