Issue credentials
You issue a credential by sending the holder an offer made from a credential template. The offer method depends on the credential's format:
| Format | Ecosystems | Method | How the holder gets the offer |
|---|---|---|---|
| AnonCreds | cheqd, Indicio | offerCredentialAnoncreds | Over a connection |
| JSON-LD | cheqd, Indicio, Polygon | offerCredentialJsonld | Over a connection |
| JSON-LD | EU Digital Identity | offerCredentialJsonld | A QR code or link |
| SD-JWT | EU Digital Identity | offerCredentialSdJwt | A QR code or link |
| mDoc | EU Digital Identity | offerCredentialMdoc | A QR code or link |
| JWT-VC | Microsoft Entra | offerCredentialJwtVc | A QR code or link |
- Get all credentials
- Get credential by ID
- Offer credential (AnonCreds)
- Offer credential (JSON-LD)
- Offer credential (SD-JWT)
- Offer credential (mDoc)
- Offer credential (JWT-VC)
Get all credentials
Lists the credentials an organization has issued.
EU Digital Identity
Microsoft Entra
cheqd
Indicio
Polygon
import { OpenIdEcosystem } from '@hovi/core-sdk';
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const credentials = await openid.getAllCredentials({
organizationId: '<ORGANIZATION_ID>',
});
import { EntraEcosystem } from '@hovi/core-sdk';
const entra = new EntraEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const credentials = await entra.getAllCredentials({
organizationId: '<ORGANIZATION_ID>',
});
import { CheqdEcosystem } from '@hovi/core-sdk';
const cheqd = new CheqdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const credentials = await cheqd.getAllCredentials({
organizationId: '<ORGANIZATION_ID>',
});
import { IndicioEcosystem } from '@hovi/core-sdk';
const indicio = new IndicioEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const credentials = await indicio.getAllCredentials({
organizationId: '<ORGANIZATION_ID>',
});
import { PrivadoEcosystem } from '@hovi/core-sdk';
const privado = new PrivadoEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const credentials = await privado.getAllCredentials({
organizationId: '<ORGANIZATION_ID>',
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
Get credential by ID
Gets one issued credential, for example to check whether the holder has accepted it.
EU Digital Identity
Microsoft Entra
cheqd
Indicio
Polygon
import { OpenIdEcosystem } from '@hovi/core-sdk';
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const credential = await openid.getCredentialById({
organizationId: '<ORGANIZATION_ID>',
credentialId: '<CREDENTIAL_ID>',
});
import { EntraEcosystem } from '@hovi/core-sdk';
const entra = new EntraEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const credential = await entra.getCredentialById({
organizationId: '<ORGANIZATION_ID>',
credentialId: '<CREDENTIAL_ID>',
});
import { CheqdEcosystem } from '@hovi/core-sdk';
const cheqd = new CheqdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const credential = await cheqd.getCredentialById({
organizationId: '<ORGANIZATION_ID>',
credentialId: '<CREDENTIAL_ID>',
});
import { IndicioEcosystem } from '@hovi/core-sdk';
const indicio = new IndicioEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const credential = await indicio.getCredentialById({
organizationId: '<ORGANIZATION_ID>',
credentialId: '<CREDENTIAL_ID>',
});
import { PrivadoEcosystem } from '@hovi/core-sdk';
const privado = new PrivadoEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const credential = await privado.getCredentialById({
organizationId: '<ORGANIZATION_ID>',
credentialId: '<CREDENTIAL_ID>',
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| credentialId | string (Required) | The ID of the credential. |
Offer credential (AnonCreds)
Offers an AnonCreds credential to a holder over a connection.
cheqd
Indicio
import { CheqdEcosystem } from '@hovi/core-sdk';
const cheqd = new CheqdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const offer = await cheqd.offerCredentialAnoncreds({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
connectionId: '<CONNECTION_ID>',
credentialValues: {
firstName: 'Jane',
lastName: 'Doe',
},
});
import { IndicioEcosystem } from '@hovi/core-sdk';
const indicio = new IndicioEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const offer = await indicio.offerCredentialAnoncreds({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
connectionId: '<CONNECTION_ID>',
credentialValues: {
firstName: 'Jane',
lastName: 'Doe',
},
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| credentialTemplateId | string (Required) | The ID of the credential template to use. |
| connectionId | string (Required) | The ID of the connection to send the offer to. |
| credentialValues | Record<string, string | number | boolean> (Required) | The value of each of the template's attributes. |
| comment | string (Optional) | A message for the holder. |
Offer credential (JSON-LD)
Offers a JSON-LD (W3C) credential. In cheqd, Indicio and Polygon the offer goes over a connection. In EU Digital Identity there's no connection: the response contains a credentialOfferUri that you show the holder as a QR code or link.
EU Digital Identity
cheqd
Indicio
Polygon
import { OpenIdEcosystem } from '@hovi/core-sdk';
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const offer = await openid.offerCredentialJsonld({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
credentialValues: {
firstName: 'Jane',
lastName: 'Doe',
},
});
import { CheqdEcosystem } from '@hovi/core-sdk';
const cheqd = new CheqdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const offer = await cheqd.offerCredentialJsonld({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
connectionId: '<CONNECTION_ID>',
credentialValues: {
firstName: 'Jane',
lastName: 'Doe',
},
});
import { IndicioEcosystem } from '@hovi/core-sdk';
const indicio = new IndicioEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const offer = await indicio.offerCredentialJsonld({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
connectionId: '<CONNECTION_ID>',
credentialValues: {
firstName: 'Jane',
lastName: 'Doe',
},
});
import { PrivadoEcosystem } from '@hovi/core-sdk';
const privado = new PrivadoEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const offer = await privado.offerCredentialJsonld({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
connectionId: '<CONNECTION_ID>',
credentialValues: {
firstName: 'Jane',
lastName: 'Doe',
},
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| credentialTemplateId | string (Required) | The ID of the credential template to use. |
| credentialValues | Record<string, string | number | boolean> (Required) | The value of each of the template's attributes. |
| connectionId | string (Optional) | cheqd, Indicio and Polygon: the ID of the connection to send the offer to. |
| holderDid | string (Optional) | cheqd and Indicio only: the holder's DID. |
| comment | string (Optional) | A message for the holder. |
| codeflow | string (Optional) | EU Digital Identity only: the issuance flow. The default is pre-authorized. |
| preAuthorizedCodeflowConfig | { useTransactionCode?: boolean; transactionCode?: { description?: string; length?: number } } (Optional) | EU Digital Identity only: ask the holder for a transaction code (PIN). The code has 6 to 10 digits; the default is 6. |
Offer credential (SD-JWT)
Offers an SD-JWT credential. The response contains a credentialOfferUri that you show the holder as a QR code or link. This example also asks the holder for a 6-digit transaction code. The response then contains the transactionCode, which you give the holder separately.
EU Digital Identity
import { OpenIdEcosystem } from '@hovi/core-sdk';
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const offer = await openid.offerCredentialSdJwt({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
credentialValues: {
firstName: 'Jane',
lastName: 'Doe',
},
preAuthorizedCodeflowConfig: {
useTransactionCode: true,
transactionCode: { length: 6, description: 'Enter your 6-digit code' },
},
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| credentialTemplateId | string (Required) | The ID of the credential template to use. |
| credentialValues | Record<string, string | number | boolean> (Required) | The value of each of the template's attributes. |
| codeflow | string (Optional) | The issuance flow. The default is pre-authorized. |
| preAuthorizedCodeflowConfig | { useTransactionCode?: boolean; transactionCode?: { description?: string; length?: number } } (Optional) | Ask the holder for a transaction code (PIN) when they accept. The code has 6 to 10 digits; the default is 6. |
Offer credential (mDoc)
Offers an mDoc credential. The response contains a credentialOfferUri that you show the holder as a QR code or link.
EU Digital Identity
import { OpenIdEcosystem } from '@hovi/core-sdk';
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const offer = await openid.offerCredentialMdoc({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
credentialValues: {
firstName: 'Jane',
lastName: 'Doe',
},
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| credentialTemplateId | string (Required) | The ID of the credential template to use. |
| credentialValues | Record<string, string | number | boolean> (Required) | The value of each of the template's attributes. |
| codeflow | string (Optional) | The issuance flow. The default is pre-authorized. |
| preAuthorizedCodeflowConfig | { useTransactionCode?: boolean; transactionCode?: { description?: string; length?: number } } (Optional) | Ask the holder for a transaction code (PIN) when they accept. The code has 6 to 10 digits; the default is 6. |
Offer credential (JWT-VC)
Offers a Microsoft Entra Verified ID credential. The holder accepts it in Microsoft Authenticator.
Microsoft Entra
import { EntraEcosystem } from '@hovi/core-sdk';
const entra = new EntraEcosystem({
apiKey: '<YOUR_API_KEY>',
});
const offer = await entra.offerCredentialJwtVc({
organizationId: '<ORGANIZATION_ID>',
credentialTemplateId: '<CREDENTIAL_TEMPLATE_ID>',
credentialValues: {
firstName: 'Jane',
lastName: 'Doe',
},
pinRequired: true,
pinLength: 6,
});
Params
| Parameter | Type | Description |
|---|---|---|
| organizationId | string (Required) | Your organization ID. |
| credentialTemplateId | string (Required) | The ID of the credential template to use. |
| credentialValues | Record<string, string | number | boolean> (Required) | The value of each of the template's attributes. |
| pinRequired | boolean (Optional) | Ask the holder for a PIN when they accept. |
| pinLength | number (Optional) | The number of PIN digits, from 4 to 16. The default is 4. |
| credentialExpiry | number (Optional) | How long the credential is valid, in seconds. If you leave it out, the template's setting is used. |