Start a disclosure
Use the Ver.iD JavaScript SDK to start the disclosure, keep the PKCE verifier, finish the session on the callback, and verify the disclosure token.
Copy the issuer URI and client identifier from the active disclosure's Configuration tab. The redirect URI must be registered on the disclosure.
Start the session
yarn add @ver-id/browser-clientimport { VeridBrowserDisclosureClient } from '@ver-id/browser-client';
const disclosureClient = new VeridBrowserDisclosureClient({
issuerUri: '<ISSUER_URI>',
clientId: '<DISCLOSURE_CLIENT_ID>',
redirectUri: 'https://example.com/disclosure/callback',
});
const { url } = await disclosureClient.createSession();
window.location.assign(url);Finish the session
On the registered callback page, create the same client and finish the session:
const result = await disclosureClient.finishSession();
if (result.format === 'disclosure_v1') {
console.log(result.payload);
}finishSession reads the callback from the page's URL, exchanges the authorization code and verifies the disclosure token before returning it. The result's format follows the output format configured on the disclosure.
Settings per request
Pass settings to createSession when one request needs settings that differ from the default flow configuration. The SDK sends them with the session's intent.
const { url } = await disclosureClient.createSession({
challenge: '<OPTIONAL_CHALLENGE_UUID>',
brandUuid: '<OPTIONAL_BRAND_UUID>',
});All settings are optional:
| Setting | Effect |
|---|---|
challenge | Associates an optional challenge UUID with this run. |
brandUuid | Uses an active brand attached to the disclosure. |
For a server-side integration, use @ver-id/node-client and keep the client secret on the server. Never include a client secret in browser code.
See the complete @ver-id/browser-client disclosure guide for cache options and result types.