Skip to main content

Credentials

Credentials in the Cloud Wallet SDK represent digital credentials issued to or managed by a wallet. This section covers methods to resolve, preview, accept, decline, and delete credentials, as well as retrieve credential offers and stored credentials.

Resolve OpenID URI

Resolves an OpenID URI to retrieve details about a credential offer.

import { CloudWallet } from '@hovi/cloudwallet-sdk';

const wallet = new CloudWallet({
apiKey: 'your-ecosystem-api-key',
});

const result = await wallet.resolveOpenIdUri({
protocol: 'openid',
credentialOfferUri: 'https://example.com/credential-offer',
});

Params

ParameterTypeDescription
protocolstring (Required)The protocol used for the credential offer (e.g., openid).
credentialOfferUristring (Required)The URI of the credential offer to resolve.
note
  • Use this method to retrieve metadata about a credential offer before accepting it.
  • Ensure the credentialOfferUri is valid and matches the specified protocol.

Preview Credential Offer

Previews a credential offer to inspect its details.

import { CloudWallet } from '@hovi/cloudwallet-sdk';

const wallet = new CloudWallet({
apiKey: 'your-ecosystem-api-key',
});

const result = await wallet.previewCredentialOffer({
protocol: 'openid',
});

Params

ParameterTypeDescription
protocolstring (Required)The protocol used for the credential offer (e.g., openid).
credentialOfferUri?string (Optional)The URI of the credential offer to preview.
credentialId?string (Optional)The ID of the credential to preview.
transactionCode?string (Optional)A transaction code associated with the offer.
note
  • At least one of credentialOfferUri or credentialId must be provided.
  • Use this to review credential details before accepting or declining.

Accept Credential Offer

Accepts a credential offer to store it in the wallet.

import { CloudWallet } from '@hovi/cloudwallet-sdk';

const wallet = new CloudWallet({
apiKey: 'your-ecosystem-api-key',
});

const result = await wallet.acceptCredentialOffer({
protocol: 'openid',
});

Params

ParameterTypeDescription
protocolstring (Required)The protocol used for the credential offer (e.g., openid).
credentialOfferUri?string (Optional)The URI of the credential offer to accept.
credentialId?string (Optional)The ID of the credential to accept.
note
  • At least one of credentialOfferUri or credentialId must be provided.
  • Accepted credentials are stored in the wallet for future use.

Decline Credential Offer

Declines a credential offer, rejecting it from being stored in the wallet.

import { CloudWallet } from '@hovi/cloudwallet-sdk';

const wallet = new CloudWallet({
apiKey: 'your-ecosystem-api-key',
});

const result = await wallet.declineCredentialOffer({
protocol: 'openid',
credentialId: 'cred-123',
});

Params

ParameterTypeDescription
protocolstring (Required)The protocol used for the credential offer (e.g., openid).
credentialIdstring (Required)The ID of the credential to decline.
note
  • Use this to reject unwanted credential offers.
  • Declined credentials are not stored in the wallet.

Delete Credential

Deletes a credential from the wallet.

import { CloudWallet } from '@hovi/cloudwallet-sdk';

const wallet = new CloudWallet({
apiKey: 'your-ecosystem-api-key',
});

const result = await wallet.deleteCredential({
credentialId: 'cred-123',
});

Params

ParameterTypeDescription
credentialIdstring (Required)The ID of the credential to delete.
note
  • This action is irreversible and removes the credential from the wallet.
  • Ensure no active operations rely on the credential before deletion.

Get Credential Offers

Retrieves a list of all credential offers for the wallet.

import { CloudWallet } from '@hovi/cloudwallet-sdk';

const wallet = new CloudWallet({
apiKey: 'your-ecosystem-api-key',
});

const result = await wallet.getCredentialOffers();

Get Stored Credentials

Retrieves a list of all credentials stored in the wallet.

import { CloudWallet } from '@hovi/cloudwallet-sdk';

const wallet = new CloudWallet({
apiKey: 'your-ecosystem-api-key',
});

const result = await wallet.getStoredCredentials();