> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.adid.dev/llms.txt.
> For full documentation content, see https://docs.adid.dev/llms-full.txt.

# SDK — Credential Operations

Source: `packages/sdk/src/credentials.ts`.

| SDK method                                    | Endpoint                              |
| --------------------------------------------- | ------------------------------------- |
| `issueCredential(params)`                     | `POST /api/v1/credentials/issue`      |
| `verifyCredential(vc)`                        | `POST /api/v1/credentials/verify`     |
| `revokeCredential(id, reason)`                | `POST /api/v1/credentials/revoke`     |
| `getCredential(id)`                           | `GET /api/v1/credentials/{id}`        |
| `checkRevocationStatus(id)`                   | `GET /api/v1/credentials/{id}/status` |
| `createPresentation(params)`                  | `POST /api/v1/presentations/create`   |
| `verifyPresentation(vp, challenge?, domain?)` | `POST /api/v1/presentations/verify`   |

#### Example: issue → present → verify

```ts
import type { VerifiableCredential, VerifiablePresentation } from '@infinia/ida-sdk';

// 1. Issue
const vc: VerifiableCredential = await client.issueCredential({
  issuerDid: 'did:adi:university…',
  issuerName: 'Acme University',
  subjectDid: 'did:adi:alice…',
  type: ['VerifiableCredential', 'UniversityDegreeCredential'],
  credentialSubject: { degree: 'MSc', graduationDate: '2026-06-15' },
  schemaId: '01HXVN…',
});

// 2. Holder builds VP (same SDK, different identity)
const vp: VerifiablePresentation = await holderClient.createPresentation({
  holderDid: 'did:adi:alice…',
  credentialIds: [vc.id],
  challenge: '<verifier-challenge>',
  domain: 'verifier.example.com',
});

// 3. Verifier verifies
const result = await verifierClient.verifyPresentation(vp, '<verifier-challenge>', 'verifier.example.com');
if (!result.valid) {
  console.error('VP failed:', result.errors);
}
```

#### Revocation

```ts
await issuerClient.revokeCredential(vc.id, 'subject violated terms');
const { revoked } = await anyClient.checkRevocationStatus(vc.id);
console.assert(revoked === true);
```