This is an Alpha release of this package, it is only intended to be used by @inrupt/solid-client-access-grants for now.

@inrupt/solid-client-vc / issue

Module: issue#

References#

default#

Renames and re-exports issueVerifiableCredential

Functions#

issueVerifiableCredential#

issueVerifiableCredential(issuerEndpoint, subjectClaims, credentialClaims, options): Promise<DatasetWithId>

Request that a given Verifiable Credential (VC) Issuer issues a VC containing the provided claims. The VC Issuer is expected to implement the W3C VC Issuer HTTP API.

Parameters#

Name

Type

Description

issuerEndpoint

string

The /issue endpoint of the VC Issuer.

subjectClaims

JsonLd

Claims about the subject that will be attested by the VC.

credentialClaims

JsonLd

Claims about the credential itself, rather than its subject, e.g. credential type or expiration.

options

Object

options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API. This can be typically used for authentication. Note that if it is omitted, and @inrupt/solid-client-authn-browser is in your dependencies, the default session is picked up. - options.returnLegacyJsonld: Include the normalized JSON-LD in the response

options.fetch?

(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>(input: string | Request | URL, init?: RequestInit) => Promise<Response>

MDN Reference

options.returnLegacyJsonld

false

-

Returns#

Promise<DatasetWithId>

the VC returned by the Issuer if the request is successful. Otherwise, an error is thrown.

Since

0.1.0

Defined in#

src/issue/issue.ts:63

issueVerifiableCredential(issuerEndpoint, subjectClaims, credentialClaims?, options?): Promise<VerifiableCredential>

Request that a given Verifiable Credential (VC) Issuer issues a VC containing the provided claims. The VC Issuer is expected to implement the W3C VC Issuer HTTP API.

Parameters#

Name

Type

Description

issuerEndpoint

string

The /issue endpoint of the VC Issuer.

subjectClaims

JsonLd

Claims about the subject that will be attested by the VC.

credentialClaims?

JsonLd

Claims about the credential itself, rather than its subject, e.g. credential type or expiration.

options?

Object

options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API. This can be typically used for authentication. Note that if it is omitted, and @inrupt/solid-client-authn-browser is in your dependencies, the default session is picked up. - options.returnLegacyJsonld: Include the normalized JSON-LD in the response

options.fetch?

(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>(input: string | Request | URL, init?: RequestInit) => Promise<Response>

MDN Reference

options.normalize?

(object: VerifiableCredentialBase) => VerifiableCredentialBase

-

options.returnLegacyJsonld?

true

-

Returns#

Promise<VerifiableCredential>

the VC returned by the Issuer if the request is successful. Otherwise, an error is thrown.

Since

0.1.0

Deprecated

Deprecated in favour of setting returnLegacyJsonld: false. This will be the default value in future versions of this library.

Defined in#

src/issue/issue.ts:91

issueVerifiableCredential(issuerEndpoint, subjectClaims, credentialClaims?, options?): Promise<DatasetWithId>

Request that a given Verifiable Credential (VC) Issuer issues a VC containing the provided claims. The VC Issuer is expected to implement the W3C VC Issuer HTTP API.

Parameters#

Name

Type

Description

issuerEndpoint

string

The /issue endpoint of the VC Issuer.

subjectClaims

JsonLd

Claims about the subject that will be attested by the VC.

credentialClaims?

JsonLd

Claims about the credential itself, rather than its subject, e.g. credential type or expiration.

options?

Object

options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API. This can be typically used for authentication. Note that if it is omitted, and @inrupt/solid-client-authn-browser is in your dependencies, the default session is picked up. - options.returnLegacyJsonld: Include the normalized JSON-LD in the response

options.fetch?

(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>(input: string | Request | URL, init?: RequestInit) => Promise<Response>

MDN Reference

options.normalize?

(object: VerifiableCredentialBase) => VerifiableCredentialBase

-

options.returnLegacyJsonld?

boolean

-

Returns#

Promise<DatasetWithId>

the VC returned by the Issuer if the request is successful. Otherwise, an error is thrown.

Since

0.1.0

Deprecated

Deprecated in favour of setting returnLegacyJsonld: false. This will be the default value in future versions of this library.

Defined in#

src/issue/issue.ts:120