Skip to main content

Connections

Connections represent peer-to-peer relationships between tenants and other entities across multiple ecosystems (OpenID, Privado ID, Indicio, Cheqd), enabling credential issuance and proof requests. This section covers methods to create invitations, retrieve connections, and manage them effectively.

Create Connection Invitation

Creates an invitation for establishing a new connection in the specified ecosystem.

import { OpenIDEcosystem } from '@openid/core-sdk';

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

const invitation = await openid.createConnectionInvitation({
tenantId: 'your-tenant-id',
label: 'New Connection',
alias: 'partner-conn',
imageUrl: 'https://example.com/logo.png',
domain: 'example.com',
multiUseInvitation: true,
autoAcceptConnection: false,
});

Params

ParameterTypeDescription
tenantIdstring (Required)The ID of the tenant initiating the invitation.
labelstring (Required)A human-readable label for the invitation.
aliasstring (Optional)An alias for the connection.
imageUrlstring (Optional)A URL for the connection's image or logo.
domainstring (Optional)The domain associated with the invitation.
multiUseInvitationboolean (Optional)Whether the invitation can be used multiple times (default: false).
autoAcceptConnectionboolean (Optional)Whether the connection should be auto-accepted (default: false).
note
  • The invitationUrl can be shared with the recipient to establish the connection.
  • Use multiUseInvitation for reusable invitations with caution.

Get Connections

Retrieves a list of connections associated with a tenant, with optional filters, in the specified ecosystem.

import { OpenIDEcosystem } from '@openid/core-sdk';

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

const connections = await openid.getConnections({
tenantId: 'your-tenant-id',
connectionId: 'your-connection-id',
invitationId: 'inv-789',
});

Params

ParameterTypeDescription
tenantIdstring (Required)The ID of the tenant to query.
connectionIdstring (Optional)The ID of a specific connection to retrieve (if omitted, returns all connections for the tenant).
invitationIdstring (Optional)The ID of the invitation to filter connections by.
note
  • Use connectionId or invitationId to narrow down the results, or omit both for a full list.
  • Check GetConnectionsResponse for the full structure of returned objects.

Get Connection by ID

Retrieves details of a specific connection by its ID in the specified ecosystem.

import { OpenIDEcosystem } from '@openid/core-sdk';

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

const connection = await openid.getConnectionById({
tenantId: 'your-tenant-id',
connectionId: 'your-connection-id',
});

Params

ParameterTypeDescription
tenantIdstring (Required)The ID of the tenant owning the connection.
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 tenant.

Delete Connection

Deletes a connection from a tenant in the specified ecosystem.

import { OpenIDEcosystem } from '@openid/core-sdk';

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

const result = await openid.deleteConnection({
tenantId: 'your-tenant-id',
connectionId: 'your-connection-id',
});

Params

ParameterTypeDescription
tenantIdstring (Required)The ID of the tenant owning the connection.
connectionIdstring (Required)The ID of the connection to delete.
note
  • This action is irreversible and terminates the connection.
  • Ensure no active operations (e.g., proof requests) rely on the connection before deletion.