Parsing options containing the URI and allowed schemes
Parsed credential offer URI components with scheme and parameters
const parsed = await parseCredentialOfferUri({
uri: "openid-credential-offer://?credential_offer=%7B%22credential_issuer%22%3A..."
});
console.log(parsed.scheme); // "openid-credential-offer"
console.log(parsed.credential_offer); // URL-decoded JSON string
const parsed = await parseCredentialOfferUri({
uri: "https://wallet.example.com/credential-offer?credential_offer_uri=https://issuer.example.com/offers/123"
});
console.log(parsed.scheme); // "https"
console.log(parsed.credential_offer_uri); // "https://issuer.example.com/offers/123"
Parses a credential offer URI and extracts the scheme and parameters.
This function supports three URL schemes for credential offers:
openid-credential-offer://- Standard OpenID scheme (custom URL scheme)haip-vci://- High Assurance Interoperability Profile scheme (custom URL scheme)https://- HTTPS Universal Links (preferred method)Credential offers can be transmitted in two ways:
credential_offerparameter contains the JSON directly (URL-encoded)credential_offer_uriparameter points to a URL where the JSON can be fetched