# @contentgrid/problem-details

> RFC9547 Problem Details types and helpers

Latest version **0.4.5** (published 2026-11-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @contentgrid/problem-details
pnpm add @contentgrid/problem-details
yarn add @contentgrid/problem-details
bun add @contentgrid/problem-details
```

## Health

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

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

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.4.5 |
| Published | 2026-11-12 |
| First published | 2023-09-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 9.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Maintainers | xenit-jenkins |
| Keywords | RFC7807, RFC9547, problem, problem-details |

## Links

- npm: https://www.npmjs.com/package/@contentgrid/problem-details
- Repository: https://github.com/xenit-eu/contentgrid-ts
- Homepage: https://github.com/xenit-eu/contentgrid-ts#readme
- Issues: https://github.com/xenit-eu/contentgrid-ts/issues
- npm.io page: https://npm.io/package/@contentgrid/problem-details

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^2.6.1
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^8.0.0

## Recent versions

- 0.4.5 (latest) — 2026-11-12
- 0.4.4 — 2026-09-28
- 0.4.2 — 2025-03-24
- 0.4.1 — 2024-10-18
- 0.4.0 — 2024-07-08
- 0.3.0 — 2024-04-03
- 0.2.0 — 2023-09-28

## README

# `@contentgrid/problem-details`

[RFC 9457](https://datatracker.ietf.org/doc/html/rfc9567) Problem Details types and helpers

## Usage

```typescript
import { ProblemDetail, ProblemDetailError, checkResponse } from '@contentgrid/problem-details'

// Fetch data from somewhere
fetch('/some-url')
    .then(checkResponse) // Throws ProblemDetailError if an error response is returned
    .then(response => {
        // Handle succesfull response
    }, error => {
        // Handle error response
        if(error instanceof ProblemDetailError) {
            // ProblemDetail is available on the ProblemDetailError
            console.error("Failed to fetch", error.problemDetail.title)
        } else {
            console.error("Failed to fetch", error);
        }
    })
```

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