Skip to main content

Authentication

The Core SDK has one class per ecosystem. You create the class with that ecosystem's API key, which you get in Hovi Studio (see Get an API key).

EcosystemClassThe API key starts with
EU Digital IdentityOpenIdEcosystemopenId
Microsoft EntraEntraEcosystementra
cheqdCheqdEcosystemcheqd
IndicioIndicioEcosystemindicio
PolygonPrivadoEcosystemprivado

If the key is missing or belongs to another ecosystem, the constructor throws an error.

Initialization​

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

// This example uses EU Digital Identity. Every class works the same way.
const openid = new OpenIdEcosystem({
apiKey: '<YOUR_API_KEY>',
});

Options​

ParameterTypeDescription
apiKeystring (Required)Your ecosystem API key.
apiBaseUrlstring (Optional)The base URL of the Hovi Connect API. The default is https://api.hovi.id.

Most methods also take the organizationId of the organization you act for. You get it when you create an organization.

Error handling​

When a call fails, the SDK throws a standard Error. Its message includes the HTTP status and the reason, for example Axios Error 401: …. Wrap your calls in try/catch:

try {
const organizations = await openid.getAllOrganizations();
} catch (error) {
console.error((error as Error).message);
}