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
| Parameter | Type | Description |
|---|---|---|
| tenantId | string (Required) | The ID of the tenant initiating the invitation. |
| label | string (Required) | A human-readable label for the invitation. |
| alias | string (Optional) | An alias for the connection. |
| imageUrl | string (Optional) | A URL for the connection's image or logo. |
| domain | string (Optional) | The domain associated with the invitation. |
| multiUseInvitation | boolean (Optional) | Whether the invitation can be used multiple times (default: false). |
| autoAcceptConnection | boolean (Optional) | Whether the connection should be auto-accepted (default: false). |
note
- The
invitationUrlcan be shared with the recipient to establish the connection. - Use
multiUseInvitationfor 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
| Parameter | Type | Description |
|---|---|---|
| tenantId | string (Required) | The ID of the tenant to query. |
| connectionId | string (Optional) | The ID of a specific connection to retrieve (if omitted, returns all connections for the tenant). |
| invitationId | string (Optional) | The ID of the invitation to filter connections by. |
note
- Use
connectionIdorinvitationIdto narrow down the results, or omit both for a full list. - Check
GetConnectionsResponsefor 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
| Parameter | Type | Description |
|---|---|---|
| tenantId | string (Required) | The ID of the tenant owning the connection. |
| 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 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
| Parameter | Type | Description |
|---|---|---|
| tenantId | string (Required) | The ID of the tenant owning the connection. |
| connectionId | string (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.