Connections
Connections in the Cloud Wallet SDK represent peer-to-peer relationships between wallets and other entities, enabling secure interactions like credential issuance and proof requests. This section covers methods to create, retrieve, and manage connections.
Accept Connection Invitation
Accepts an invitation to establish a new connection.
import { CloudWallet } from '@hovi/cloudwallet-sdk';
const wallet = new CloudWallet({
  apiKey: 'your-ecosystem-api-key',
});
const result = await wallet.acceptConnectionInvitation({
  protocol: 'didcomm',
  invitation: 'eyJAdHlwZSI6Imh0dHBzOi8vZGlkY29tbS5vcmcvb3V0LW9mLWJhbmQvMS4xL2ludml0YXRpb24iLCJ...',
});
Params
| Parameter | Type | Description | 
|---|---|---|
| protocol | string (Required) | The protocol used for the connection (e.g., didcomm). | 
| invitation | string (Required) | The invitation string or URL for establishing the connection. | 
| label? | string (Optional) | A human-readable label for the connection. | 
note
- The 
invitationshould be a valid invitation string or URL provided by the inviting party. - Ensure the 
protocolmatches the invitation's requirements. 
Get Connections
Retrieves a list of all connections associated with the wallet.
import { CloudWallet } from '@hovi/cloudwallet-sdk';
const wallet = new CloudWallet({
  apiKey: 'your-ecosystem-api-key',
});
const result = await wallet.getConnections();
note
- This method retrieves all connections for the wallet without requiring parameters.
 - Check 
GetAllConnectionResponsefor the full structure of returned objects. 
Get Connection by ID
Retrieves details of a specific connection by its ID.
import { CloudWallet } from '@hovi/cloudwallet-sdk';
const wallet = new CloudWallet({
  apiKey: 'your-ecosystem-api-key',
});
const result = await wallet.getConnectionById({
  connectionId: 'conn-456',
});
Params
| Parameter | Type | Description | 
|---|---|---|
| connectionId | string (Required) | The ID of the connection to retrieve. | 
note
- Use this to check the status or details of a specific connection.
 - Ensure the 
connectionIdis valid and associated with the wallet.