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
- Preview Credential Offer
- Accept Credential Offer
- Decline Credential Offer
- Delete Credential
- Get Credential Offers
- Get 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
| Parameter | Type | Description |
|---|---|---|
| protocol | string (Required) | The protocol used for the credential offer (e.g., openid). |
| credentialOfferUri | string (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
credentialOfferUriis valid and matches the specifiedprotocol.
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
| Parameter | Type | Description |
|---|---|---|
| protocol | string (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
credentialOfferUriorcredentialIdmust 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
| Parameter | Type | Description |
|---|---|---|
| protocol | string (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
credentialOfferUriorcredentialIdmust 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
| Parameter | Type | Description |
|---|---|---|
| protocol | string (Required) | The protocol used for the credential offer (e.g., openid). |
| credentialId | string (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
| Parameter | Type | Description |
|---|---|---|
| credentialId | string (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();