# JavaScript SDK

Official JavaScript SDK for the Aho Verifiable Credentials API.

## Installation

```
npm install @aho-sdk/core
```

## Quick Start

### Issue a Credential

issue\_credential.ts

```
// Issue a credential to an employee
import { AhoSdk } from '@aho/sdk';

const client = AhoSdk.issuer({ apiKey: process.env.AHO_API_KEY });

const credential = await client.credentials.create({
    body: {
      schemaId: "EmployeeCredential",
      subjectIdentifier: "did:key:z6Mk...",
      claims: {
        employeeId: "12345",
        department: "Engineering"
      }
    }
  });
```

### Create a Verification Request

create\_verification\_request.ts

```
// Create a verification request for age check
import { AhoSdk } from '@aho/sdk';

const client = AhoSdk.verifier({ apiKey: process.env.AHO_API_KEY });

const request = await client.requests.create({
    body: {
      name: "Age Check",
      purpose: "Verify customer is over 21"
    }
  });
```

### Check Verification Response

get\_verification\_response.ts

```
// Check if the user verified successfully
import { AhoSdk } from '@aho/sdk';

const client = AhoSdk.verifier({ apiKey: process.env.AHO_API_KEY });

const response = await client.responses.get({
    requestUuid: "req_abc123",
    uuid: "resp_xyz789"
  });
```

## Available Clients

The SDK provides clients for each API domain:

| Client | Purpose | API Key Type |
| --- | --- | --- |
| `Issuer` | Issue and manage verifiable credentials | Issuer API Key |
| `Verifier` | Create presentation requests and verify credentials | Verifier API Key |
| `Holder` | Manage holder credentials and presentations | Holder API Key |
| `Account` | Manage account settings, domains, and API keys | Holder/Verifier/Issuer API Key |
| `Schemas` | Manage render templates for credential schemas | Issuer API Key |
| `Public` | Public endpoints (schema catalog, no authentication) | None |

### API Reference

See the full API documentation with request/response examples for all endpoints.

[View API Reference](https://aho.com/docs/api)