Skip to navigation

End-to-End Examples

View as Markdown

A complete issue → present → verify round-trip:

import { IDAClient } from '@infinia/ida-sdk';
const issuer = new IDAClient({ baseUrl, jwt: ISSUER_JWT });
const holder = new IDAClient({ baseUrl, jwt: HOLDER_JWT });
const verifier = new IDAClient({ baseUrl, jwt: VERIFIER_JWT });
// 1. Issuer signs a credential
const vc = await issuer.issueCredential({
schemaId: 'kyc-v1',
subject: HOLDER_DID,
claims: { country: 'AE', ageOver: 18 },
});
// 2. Holder builds a presentation
const vp = await holder.createPresentation({
credentialIds: [vc.id],
challenge: 'verifier-nonce',
});
// 3. Verifier checks
const result = await verifier.verifyPresentation(vp);
console.log(result.valid); // true