- CredentialService().getById(credentialId: string) : Fetches the credential from crossmint using the credentialId.
- CredentialService().getCredential(collection: CredentialsCollection, tokenId: string) : Fetches the credential from the source that matches the storage location of the credential.
Remarks
To use the Crossmint procedure, a Crossmint API key with thecredentials.read scope must be set.
Extends
CredentialService
Constructors
new CredentialService()
new CredentialService(retrievalProcedures):CredentialService
Parameters
Returns
CredentialService
Overrides
CredentialServiceRaw.constructor
Defined in
presentation/getCredential.ts:100Properties
Methods
getById()
getById(Retrieves a verifiable credential from Crossmint using its credential ID.credentialId):Promise<null|VerifiableCredentialType>
Parameters
Returns
Promise<null | VerifiableCredentialType>
A promise that resolves to a VerifiableCredentialType or null if the credential is not found.
Throws
Will throw an error if the credential retrieval fails.Defined in
presentation/getCredential.ts:112getCredential()
getCredential(Retrieves a Verifiable Credential from a given collection and token ID. This function finds the appropriate retrieval procedure based on the collection’s metadata and uses it to fetch the credential.collection,tokenId):Promise<VerifiableCredentialType>
Parameters
Returns
Promise<VerifiableCredentialType>
A promise that resolves to a VerifiableCredentialType.
Throws
Will throw an error if the collection is not a verifiable credential collection or if the retrieval endpoint is unsupported.Inherited from
CredentialServiceRaw.getCredential

