End-to-End Examples
End-to-End Examples
A complete issue → present → verify round-trip:
1 import { IDAClient } from '@infinia/ida-sdk'; 2 3 const issuer = new IDAClient({ baseUrl, jwt: ISSUER_JWT }); 4 const holder = new IDAClient({ baseUrl, jwt: HOLDER_JWT }); 5 const verifier = new IDAClient({ baseUrl, jwt: VERIFIER_JWT }); 6 7 // 1. Issuer signs a credential 8 const vc = await issuer.issueCredential({ 9 schemaId: 'kyc-v1', 10 subject: HOLDER_DID, 11 claims: { country: 'AE', ageOver: 18 }, 12 }); 13 14 // 2. Holder builds a presentation 15 const vp = await holder.createPresentation({ 16 credentialIds: [vc.id], 17 challenge: 'verifier-nonce', 18 }); 19 20 // 3. Verifier checks 21 const result = await verifier.verifyPresentation(vp); 22 console.log(result.valid); // true