# @gemeentenijmegen/apigateway-http

> A package useful when developing serverless functions using AWS Lambda/Apigateway. Supports the REST and HTTP flavors of the AWS API Gateway It contains:

Latest version **0.0.41** (published 2026-09-30) · EUPL-1.2 license · 0 weekly downloads

## Install

```sh
npm install @gemeentenijmegen/apigateway-http
pnpm add @gemeentenijmegen/apigateway-http
yarn add @gemeentenijmegen/apigateway-http
bun add @gemeentenijmegen/apigateway-http
```

## 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.41 |
| Published | 2026-09-30 |
| First published | 2022-10-25 |
| Weekly downloads | 0 |
| License | EUPL-1.2 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 36.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Maintainers | espernijmegen, teppei01, jvanderborg, martijnvdijk, bramwithaar, marnixdessing, wkremer |

## Links

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

## Dependencies (1)

- [@types/aws-lambda](https://npm.io/package/@types/aws-lambda.md) ^8.10.162

## Recent versions

- 0.0.41 (latest) — 2026-09-30
- 0.0.40 — 2026-08-06
- 0.0.39 — 2026-05-18
- 0.0.38 — 2026-04-21
- 0.0.37 — 2026-03-12
- 0.0.36 — 2026-02-06
- 0.0.35 — 2026-01-05
- 0.0.34 — 2025-12-04
- 0.0.33 — 2025-10-23
- 0.0.32 — 2025-10-15
- 0.0.31 — 2025-09-23
- 0.0.30 — 2025-08-19
- 0.0.29 — 2025-07-24
- 0.0.28 — 2025-07-11
- 0.0.27 — 2025-06-18
- … 25 more at https://npm.io/package/@gemeentenijmegen/apigateway-http/versions

## README

# AWS Apigateway HTTP helpers

A package useful when developing serverless functions using AWS Lambda/Apigateway. Supports the REST and HTTP flavors 
of the AWS API Gateway It contains:

## V1/Response
A response object with several methods for common http responses. Return these from your lambda handler:


For V1 (rest) responses:
```
import { Response } from '@gemeentenijmegen/apigateway-http/lib/V1/Response';
```

For V2 (http) responses: 
```
import { Response } from '@gemeentenijmegen/apigateway-http/lib/V2/Response';
```

Then use like this:

```
// Redirect to https://example.com
Response.redirect('https://example.com');

// Permanently redirect to https://example.com
Response.redirect('https://example.com', 301);

// Return http 403: Not allowed response
Response.error(403);

// Return a html page
Response.html('<!doctype html><html><head><title>My page</title></head><body>The html body</body></html>');

// Return a json response from a javascript object
Response.html({ key: 'value' });
```

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