The Access Credential (Access Grant or Access Request)
an object keyed by the custom fields names, associated to their values.
const accessRequest = await issueAccessRequest({...}, {
...,
customFields: new Set([
{
key: new URL("https://example.org/ns/customString"),
value: "custom value",
},
{
key: new URL("https://example.org/ns/customInteger"),
value: 1,
},
]),
});
const customFields = getCustomFields(accessRequest);
// s is "custom value"
const s = customFields["https://example.org/ns/customString"];
// i is 1
const i = customFields["https://example.org/ns/custominteger"];
Reads all the custom fields in the consent section of the provided Access Credential. An empty object will be returned if no custom fields are found.