Connections
A connection is a secure link between a wallet and an issuer or verifier. In cheqd and Indicio, the wallet needs one before it can receive a credential or answer a proof request. These methods act on one wallet, so create the CloudWallet with that wallet's access token (see Authentication).
Accept connection invitation
Accepts a connection invitation from an issuer or verifier.
import { CloudWallet } from '@hovi/cloudwallet-sdk';
const wallet = new CloudWallet({
walletAccessToken: '<WALLET_ACCESS_TOKEN>',
apiBaseUrl: 'https://cloudwallet.hovi.id',
});
const result = await wallet.acceptConnectionInvitation({
protocol: 'didcomm',
invitation: '<INVITATION_URL>',
});
Params
| Parameter | Type | Description |
|---|---|---|
| protocol | string (Required) | Use didcomm. |
| invitation | string (Required) | The invitation URL or string from the issuer or verifier. |
| label | string (Optional) | A name for the connection. |
Get connections
Lists the wallet's connections.
import { CloudWallet } from '@hovi/cloudwallet-sdk';
const wallet = new CloudWallet({
walletAccessToken: '<WALLET_ACCESS_TOKEN>',
apiBaseUrl: 'https://cloudwallet.hovi.id',
});
const result = await wallet.getConnections();
Get connection by ID
Gets one of the wallet's connections, for example to check its state.
import { CloudWallet } from '@hovi/cloudwallet-sdk';
const wallet = new CloudWallet({
walletAccessToken: '<WALLET_ACCESS_TOKEN>',
apiBaseUrl: 'https://cloudwallet.hovi.id',
});
const result = await wallet.getConnectionById({
connectionId: '<CONNECTION_ID>',
});
Params
| Parameter | Type | Description |
|---|---|---|
| connectionId | string (Required) | The ID of the connection. |