Inspect Access Requests and Access Grants
Last updated
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"];
// s2 is also "custom value", and it is type safe.
const s2: string = getCustomString(
accessRequest,
new URL("https://example.org/ns/customString")
);
// i2 is also 1, and it is type safe.
const i2: number = getCustomInteger(
accessRequest,
new URL("https://example.org/ns/customInteger")
);