Skip to main content

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​

ParameterTypeDescription
protocolstring (Required)The protocol used for the connection (e.g., didcomm).
invitationstring (Required)The invitation string or URL for establishing the connection.
label?string (Optional)A human-readable label for the connection.
note
  • The invitation should be a valid invitation string or URL provided by the inviting party.
  • Ensure the protocol matches 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 GetAllConnectionResponse for 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​

ParameterTypeDescription
connectionIdstring (Required)The ID of the connection to retrieve.
note
  • Use this to check the status or details of a specific connection.
  • Ensure the connectionId is valid and associated with the wallet.