# @gemeentenijmegen/apiclient

> An HTTP Api Client module. Used for applications requiring mutual TLS, backed by config in AWS.

Latest version **0.0.45** (published 2026-10-01) · EUPL-1.2 license · 0 weekly downloads

## Install

```sh
npm install @gemeentenijmegen/apiclient
pnpm add @gemeentenijmegen/apiclient
yarn add @gemeentenijmegen/apiclient
bun add @gemeentenijmegen/apiclient
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.45 |
| Published | 2026-10-01 |
| First published | 2022-06-13 |
| Weekly downloads | 0 |
| License | EUPL-1.2 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 40.4 KB |
| Known vulnerabilities | 0 (+12 in 1 direct dependencies) |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Maintainers | espernijmegen, teppei01, jvanderborg, martijnvdijk, bramwithaar, marnixdessing, wkremer |

## Links

- npm: https://www.npmjs.com/package/@gemeentenijmegen/apiclient
- Repository: https://github.com/GemeenteNijmegen/modules-apiclient
- Homepage: https://github.com/GemeenteNijmegen/modules-apiclient#readme
- Issues: https://github.com/GemeenteNijmegen/modules-apiclient/issues
- npm.io page: https://npm.io/package/@gemeentenijmegen/apiclient

## Dependencies (4)

- [axios](https://npm.io/package/axios.md) 1.18.1
- [@aws-sdk/client-ssm](https://npm.io/package/@aws-sdk/client-ssm.md) ^3.1144.0
- [@gemeentenijmegen/utils](https://npm.io/package/@gemeentenijmegen/utils.md) ^0.0.38
- [@aws-sdk/client-secrets-manager](https://npm.io/package/@aws-sdk/client-secrets-manager.md) ^3.1144.0

## Recent versions

- 0.0.45 (latest) — 2026-10-01
- 0.0.44 — 2026-08-06
- 0.0.43 — 2026-05-18
- 0.0.42 — 2026-04-21
- 0.0.41 — 2026-03-16
- 0.0.40 — 2026-02-06
- 0.0.39 — 2026-01-05
- 0.0.38 — 2025-12-04
- 0.0.37 — 2025-10-31
- 0.0.36 — 2025-10-27
- 0.0.35 — 2025-08-19
- 0.0.34 — 2025-07-24
- 0.0.33 — 2025-07-11
- 0.0.32 — 2025-06-18
- 0.0.31 — 2025-05-20
- … 31 more at https://npm.io/package/@gemeentenijmegen/apiclient/versions

## README

# Gemeente Nijmegen Api Client

An HTTP Api Client module. Used for applications requiring mutual TLS, backed by config in AWS.

## How to use
Quickstart:

Install using npm: 

```npm i @gemeentenijmegen/apiclient```

The client expects either the following environment parameters to be set, or to be provided a client certificate, private key and root ca:

```
  MTLS_PRIVATE_KEY_ARN // AWS Arn to the secrets manager ARN holding the private key
  MTLS_CLIENT_CERT_NAME // The name of an SSM parameter holding the client certificate 
  MTLS_ROOT_CA_NAME // The name of an SSM parameter holding the root ca

```

Example use:
```
// create a client
const apiClient = new ApiClient();
// init (get parameters from store etc.)
await apiClient.init();
// Use the client to perform a POST request and get responses.
const data = await apiClient.postData('/test', { data: 'test ' },  {'Content-type': 'application/json'});

// Use the client to perform a GET request and get data.
const data = await apiClient.getData('/test',  {'Content-type': 'application/json'});
```
The request can throw an error, the actual message is logged, a generic Error is thrown.

---
_Source: https://npm.io/package/@gemeentenijmegen/apiclient · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
