Organization management
An organization is the issuer or verifier that works inside your ecosystem. Every other Core SDK call takes the organizationId you get when you create one. These methods work the same way in EU Digital Identity, Microsoft Entra, cheqd, Indicio and Polygon.
- Create organization
- Get all organizations
- Get organization public DID
- Rotate organization key
- Delete organization
Create organization
Creates a new organization in your ecosystem.
EU Digital Identity
Microsoft Entra
cheqd
Indicio
Polygon
import { OpenIdEcosystem } from '@hovi/core-sdk';
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const organization = await openid.createOrganization({
name: 'acme-university',
label: 'Acme University',
secret: '<ORGANIZATION_SECRET>',
imageUrl: 'https://example.com/logo.png',
});
import { EntraEcosystem } from '@hovi/core-sdk';
const entra = new EntraEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const organization = await entra.createOrganization({
name: 'acme-university',
label: 'Acme University',
secret: '<ORGANIZATION_SECRET>',
imageUrl: 'https://example.com/logo.png',
});
import { CheqdEcosystem } from '@hovi/core-sdk';
const cheqd = new CheqdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const organization = await cheqd.createOrganization({
name: 'acme-university',
label: 'Acme University',
secret: '<ORGANIZATION_SECRET>',
imageUrl: 'https://example.com/logo.png',
});
import { IndicioEcosystem } from '@hovi/core-sdk';
const indicio = new IndicioEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const organization = await indicio.createOrganization({
name: 'acme-university',
label: 'Acme University',
secret: '<ORGANIZATION_SECRET>',
imageUrl: 'https://example.com/logo.png',
});
import { PrivadoEcosystem } from '@hovi/core-sdk';
const privado = new PrivadoEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const organization = await privado.createOrganization({
name: 'acme-university',
label: 'Acme University',
secret: '<ORGANIZATION_SECRET>',
imageUrl: 'https://example.com/logo.png',
});
Params
| Parameter | Type | Description |
|---|---|---|
| name | string (Required) | A unique name for the organization. |
| label | string (Required) | The name holders see, for example in their wallet. |
| secret | string (Required) | The organization secret. You need it to delete the organization. It can't be recovered, so store it safely. |
| imageUrl | string (Required) | A URL of the organization's logo. |
| webhooks | string[] (Optional) | Webhook URLs to add to the organization. |
| dids | { did, privateKey }[] (Optional) | Existing DIDs, with their private keys, for the organization to use. |
The response contains the new organizationId, the organization's accessToken, its dids and its webhooks.
note
- Keep the
secretout of your code, for example in an environment variable.
Get all organizations
Lists the organizations in your ecosystem.
EU Digital Identity
Microsoft Entra
cheqd
Indicio
Polygon
import { OpenIdEcosystem } from '@hovi/core-sdk';
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const organizations = await openid.getAllOrganizations();
import { EntraEcosystem } from '@hovi/core-sdk';
const entra = new EntraEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const organizations = await entra.getAllOrganizations();
import { CheqdEcosystem } from '@hovi/core-sdk';
const cheqd = new CheqdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const organizations = await cheqd.getAllOrganizations();
import { IndicioEcosystem } from '@hovi/core-sdk';
const indicio = new IndicioEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const organizations = await indicio.getAllOrganizations();
import { PrivadoEcosystem } from '@hovi/core-sdk';
const privado = new PrivadoEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const organizations = await privado.getAllOrganizations();
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Optional) | Return only this organization. |
Get organization public DID
Gets the public DID (decentralized identifier) of an organization. Holders and verifiers use it to check who issued a credential.
EU Digital Identity
Microsoft Entra
cheqd
Indicio
Polygon
import { OpenIdEcosystem } from '@hovi/core-sdk';
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const did = await openid.getOrganizationPublicDid({
organizationId: '<ORGANIZATION_ID>',
});
import { EntraEcosystem } from '@hovi/core-sdk';
const entra = new EntraEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const did = await entra.getOrganizationPublicDid({
organizationId: '<ORGANIZATION_ID>',
});
import { CheqdEcosystem } from '@hovi/core-sdk';
const cheqd = new CheqdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const did = await cheqd.getOrganizationPublicDid({
organizationId: '<ORGANIZATION_ID>',
});
import { IndicioEcosystem } from '@hovi/core-sdk';
const indicio = new IndicioEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const did = await indicio.getOrganizationPublicDid({
organizationId: '<ORGANIZATION_ID>',
});
import { PrivadoEcosystem } from '@hovi/core-sdk';
const privado = new PrivadoEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const did = await privado.getOrganizationPublicDid({
organizationId: '<ORGANIZATION_ID>',
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
Rotate organization key
Replaces the organization's access token with a new one.
EU Digital Identity
Microsoft Entra
cheqd
Indicio
Polygon
import { OpenIdEcosystem } from '@hovi/core-sdk';
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await openid.rotateOrganizationKey({
organizationId: '<ORGANIZATION_ID>',
accessToken: '<CURRENT_ACCESS_TOKEN>',
organizationSecret: '<ORGANIZATION_SECRET>',
});
import { EntraEcosystem } from '@hovi/core-sdk';
const entra = new EntraEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await entra.rotateOrganizationKey({
organizationId: '<ORGANIZATION_ID>',
accessToken: '<CURRENT_ACCESS_TOKEN>',
organizationSecret: '<ORGANIZATION_SECRET>',
});
import { CheqdEcosystem } from '@hovi/core-sdk';
const cheqd = new CheqdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await cheqd.rotateOrganizationKey({
organizationId: '<ORGANIZATION_ID>',
accessToken: '<CURRENT_ACCESS_TOKEN>',
organizationSecret: '<ORGANIZATION_SECRET>',
});
import { IndicioEcosystem } from '@hovi/core-sdk';
const indicio = new IndicioEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await indicio.rotateOrganizationKey({
organizationId: '<ORGANIZATION_ID>',
accessToken: '<CURRENT_ACCESS_TOKEN>',
organizationSecret: '<ORGANIZATION_SECRET>',
});
import { PrivadoEcosystem } from '@hovi/core-sdk';
const privado = new PrivadoEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await privado.rotateOrganizationKey({
organizationId: '<ORGANIZATION_ID>',
accessToken: '<CURRENT_ACCESS_TOKEN>',
organizationSecret: '<ORGANIZATION_SECRET>',
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| accessToken | string (Required) | The organization's current access token, returned when you created the organization. |
| organizationSecret | string (Required) | The secret you set when you created the organization. |
note
- The old access token stops working as soon as the rotation succeeds.
Delete organization
Deletes an organization and all its data.
EU Digital Identity
Microsoft Entra
cheqd
Indicio
Polygon
import { OpenIdEcosystem } from '@hovi/core-sdk';
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await openid.deleteOrganization({
organizationId: '<ORGANIZATION_ID>',
organizationSecret: '<ORGANIZATION_SECRET>',
});
import { EntraEcosystem } from '@hovi/core-sdk';
const entra = new EntraEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await entra.deleteOrganization({
organizationId: '<ORGANIZATION_ID>',
organizationSecret: '<ORGANIZATION_SECRET>',
});
import { CheqdEcosystem } from '@hovi/core-sdk';
const cheqd = new CheqdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await cheqd.deleteOrganization({
organizationId: '<ORGANIZATION_ID>',
organizationSecret: '<ORGANIZATION_SECRET>',
});
import { IndicioEcosystem } from '@hovi/core-sdk';
const indicio = new IndicioEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await indicio.deleteOrganization({
organizationId: '<ORGANIZATION_ID>',
organizationSecret: '<ORGANIZATION_SECRET>',
});
import { PrivadoEcosystem } from '@hovi/core-sdk';
const privado = new PrivadoEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const result = await privado.deleteOrganization({
organizationId: '<ORGANIZATION_ID>',
organizationSecret: '<ORGANIZATION_SECRET>',
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| organizationSecret | string (Required) | The secret you set when you created the organization. |
note
- This can't be undone. All the organization's data, such as credentials and connections, is deleted too.