Skip to content

Latest commit

 

History

History
73 lines (52 loc) · 2.01 KB

File metadata and controls

73 lines (52 loc) · 2.01 KB

Logo

EDC-Connector Extension:
API Wrapper & API Clients:
TypeScript API Client

Report Bug · Request Feature

About this component

TypeScript Client Library to be imported and used in arbitrary applications like frontends or NodeJS projects.

You can find our API Wrapper Project here.

How to install

Requires global fetch API (provided by Node.js 18+ or browser).

npm i --save @sovity.de/edc-client

How to use

Configure your EDC Client and use endpoints of our API Wrapper Extension:

Example Using API Key Auth

const edcClient: EdcClient = buildEdcClient({
    managementApiUrl: 'http://localhost:11002/api/management/v2',
    managementApiKey: 'ApiKeyDefaultValue',
});

let kpiData: KpiResult = await edcClient.useCaseApi.getKpis();

A minimal example project using the typescript API client can be found here.

Example Using OAuth2 Client Credentials

const edcClient: EdcClient = buildEdcClient({
    managementApiUrl: 'http://localhost:11002/api/management/v2',
    clientCredentials: {
        tokenUrl: 'http://localhost:11002/token',
        clientId: '{{your-connector}}-app',
        clientSecret: '...',
    },
});

let kpiData: KpiResult = await edcClient.useCaseApi.getKpis();

License

Apache License 2.0 - see LICENSE

Contact

sovity GmbH - contact@sovity.de