Skip to main content

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:

FormatEcosystemsMethodHow the holder gets the offer
AnonCredscheqd, IndicioofferCredentialAnoncredsOver a connection
JSON-LDcheqd, Indicio, PolygonofferCredentialJsonldOver a connection
JSON-LDEU Digital IdentityofferCredentialJsonldA QR code or link
SD-JWTEU Digital IdentityofferCredentialSdJwtA QR code or link
mDocEU Digital IdentityofferCredentialMdocA QR code or link
JWT-VCMicrosoft EntraofferCredentialJwtVcA QR code or link

Get all credentials​

Lists the credentials an organization has issued.

import { OpenIdEcosystem } from '@hovi/core-sdk';

const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});

const credentials = await openid.getAllCredentials({
organizationId: '<ORGANIZATION_ID>',
});

Params​

ParameterTypeDescription
organizationIdstring (Required)Your organization ID.

Get credential by ID​

Gets one issued credential, for example to check whether the holder has accepted it.

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>',
});

Params​

ParameterTypeDescription
organizationIdstring (Required)Your organization ID.
credentialIdstring (Required)The ID of the credential.

Offer credential (AnonCreds)​

Offers an AnonCreds credential to a holder over a connection.

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',
},
});

Params​

ParameterTypeDescription
organizationIdstring (Required)Your organization ID.
credentialTemplateIdstring (Required)The ID of the credential template to use.
connectionIdstring (Required)The ID of the connection to send the offer to.
credentialValuesRecord<string, string | number | boolean> (Required)The value of each of the template's attributes.
commentstring (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.

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',
},
});

Params​

ParameterTypeDescription
organizationIdstring (Required)Your organization ID.
credentialTemplateIdstring (Required)The ID of the credential template to use.
credentialValuesRecord<string, string | number | boolean> (Required)The value of each of the template's attributes.
connectionIdstring (Optional)cheqd, Indicio and Polygon: the ID of the connection to send the offer to.
holderDidstring (Optional)cheqd and Indicio only: the holder's DID.
commentstring (Optional)A message for the holder.
codeflowstring (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.

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​

ParameterTypeDescription
organizationIdstring (Required)Your organization ID.
credentialTemplateIdstring (Required)The ID of the credential template to use.
credentialValuesRecord<string, string | number | boolean> (Required)The value of each of the template's attributes.
codeflowstring (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.

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​

ParameterTypeDescription
organizationIdstring (Required)Your organization ID.
credentialTemplateIdstring (Required)The ID of the credential template to use.
credentialValuesRecord<string, string | number | boolean> (Required)The value of each of the template's attributes.
codeflowstring (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.

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​

ParameterTypeDescription
organizationIdstring (Required)Your organization ID.
credentialTemplateIdstring (Required)The ID of the credential template to use.
credentialValuesRecord<string, string | number | boolean> (Required)The value of each of the template's attributes.
pinRequiredboolean (Optional)Ask the holder for a PIN when they accept.
pinLengthnumber (Optional)The number of PIN digits, from 4 to 16. The default is 4.
credentialExpirynumber (Optional)How long the credential is valid, in seconds. If you leave it out, the template's setting is used.