# contensis-delivery-api

> Client for retrieving content using the read-only Contensis Delivery API

Latest version **1.6.3** (published 2026-10-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install contensis-delivery-api
pnpm add contensis-delivery-api
yarn add contensis-delivery-api
bun add contensis-delivery-api
```

## Health

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

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

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.6.3 |
| Published | 2026-10-06 |
| First published | 2019-02-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14 |
| Dependencies | 5 |
| Unpacked size | 997 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Zengenti Ltd |
| Maintainers | s.horan, rdsaunders, danwhite, alexpop-zengenti, n.flatley, d.petrovic, fbeavan, samclifford, dcoffey-zengenti, marksummerfield |
| Keywords | contensis, cms, dxp, content, delivery, api, js, library, client |

## Links

- npm: https://www.npmjs.com/package/contensis-delivery-api
- Repository: https://github.com/contensis/contensis-delivery-api
- Homepage: https://www.contensis.com/help-and-docs/apis/delivery-js
- Issues: https://github.com/contensis/contensis-delivery-api/issues
- npm.io page: https://npm.io/package/contensis-delivery-api

## Dependencies (5)

- [tslib](https://npm.io/package/tslib.md) ^2.8.1
- [cross-fetch](https://npm.io/package/cross-fetch.md) ^3.2.0
- [es6-promise](https://npm.io/package/es6-promise.md) ^4.2.8
- [whatwg-fetch](https://npm.io/package/whatwg-fetch.md) ^3.0.0
- [contensis-core-api](https://npm.io/package/contensis-core-api.md) ^1.2.5

## Recent versions

- 1.6.3 (latest) — 2026-10-06
- 1.6.2 — 2026-02-10
- 1.6.1 — 2025-07-23
- 1.6.0 — 2025-05-27
- 1.5.0 — 2024-10-10
- 1.4.1 — 2024-04-26
- 1.4.0 — 2024-03-04
- 1.3.1 — 2024-02-20
- 1.3.0 — 2023-03-01
- 1.2.1 — 2023-01-26
- 1.2.0 — 2022-06-08
- 1.1.9 — 2022-04-14
- 1.1.8 — 2021-10-15
- 1.1.7 — 2021-03-12
- 1.1.6 — 2020-12-17
- … 25 more at https://npm.io/package/contensis-delivery-api/versions

## README

# [![Contensis](https://github.com/contensis/cli/raw/refs/heads/main/assets/contensis-logo--tiny.svg)](https://www.contensis.com) contensis-delivery-api [![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=flat&logo=typescript&logoColor=white)](https://www.typescriptlang.org/) [![NPM version](https://img.shields.io/npm/v/contensis-delivery-api.svg?style=flat)](https://www.npmjs.com/package/contensis-delivery-api)

[![JavaScript](https://img.shields.io/badge/JavaScript-323330?style=for-the-badge&logo=javascript&logoColor=F7DF1E)](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
[![Node.js](https://img.shields.io/badge/Node%20js-339933?style=for-the-badge&logo=nodedotjs&logoColor=white)](https://nodejs.org/en)

[![Angular](https://img.shields.io/badge/Angular-DD0031?style=for-the-badge&logo=angular&logoColor=white)](https://angular.dev/) [![Electron](https://img.shields.io/badge/Electron-2B2E3A?style=for-the-badge&logo=electron&logoColor=9FEAF9)](https://electronjs.org/) [![Express.js](https://img.shields.io/badge/Express%20js-000000?style=for-the-badge&logo=express&logoColor=white)](https://expressjs.com/) [![React](https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB)](https://react.dev/) [![React Native](https://img.shields.io/badge/React_Native-20232A?style=for-the-badge&logo=react&logoColor=61DAFB)](https://reactnative.dev/) [![Vue.js](https://img.shields.io/badge/Vue%20js-35495E?style=for-the-badge&logo=vuedotjs&logoColor=4FC08D)](https://vuejs.org/)

[![Contensis](https://img.shields.io/badge/Contensis-00304d?style=for-the-badge&logoColor=white&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIH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2LjQgMjEuNjc4LS4wMzgtLjA2My0uMDYyLS4wMzkgNy4yMTYgNC4wOThaIi8+PHBhdGggZmlsbD0iIzM3QkZBNyIgZD0iTTMzLjIwMi40MTFDMjUuNzQ1IDEzLjAyIDE1LjcyMyAyMS43MjIgMTUuMDkxIDI3LjQ5Yy0uNTkgNS4zODggMS4zNiA5LjgzNyA0LjU1NCAxMi42MDRhODEuMDg2IDgxLjA4NiAwIDAgMCAzLjYxNC00Ljg4Yy0uMDU4LTEuMTE0LS40ODItOS44MTUuNDQtMTIuMjY0LjUyNyAzLjc3OCAxLjYxNiA3LjI2NSAyLjAyIDguNDgzYTExMy45NDggMTEzLjk0OCAwIDAgMCAyLjc0Ni00LjY4NWMtLjA4My0yLjIxMy0uMzEzLTEwLjAwOC40Ni0xMS43OTQuMjA1IDIuNTc1IDEuMTYzIDUuODUyIDEuNzM4IDcuNjM3Ljc2NC0xLjUyMyAxLjE4My0yLjQ1IDEuMTkzLTIuNDcybDIuNzA1LTYuMDE2LS43MSA2LjU0NWMtLjAwNC4wMzQtLjI0MiAyLjE5My0uODIgNS40NzggMS41ODYtMS4yODkgNC4xMDQtMy40NTcgNS4zMjgtNS4xNi4xMDUgMi4wNTQtNC40NDQgNy41NTYtNi4xOTMgOS41OTQtLjE4My44NDktLjM4MiAxLjczLS42IDIuNjM1LS4xNTQuNjQtLjMxMiAxLjI3LS40NzMgMS44OSAxLjUxNy0uODQyIDQuOTkyLTIuODYgNi45MzItNC42OTctLjI5NCAyLjA5NS02LjQ2IDcuNDE5LTguMDkgOC43OTRhODAuMTYxIDgwLjE2MSAwIDAgMS0xLjMzNiAzLjk4YzMuNzQ0LS4yMTMgNy42NzYtMi4xIDEwLjk2OC02LjEzNkM0OS40MDcgMjQuOTYgMzUuNjcyLTMuNzY1IDMzLjIwMi40MTFaIi8+PC9zdmc+)](https://www.contensis.com)
[![Contensis Slack](https://img.shields.io/badge/Slack-4A154B?style=for-the-badge&logo=slack&logoColor=white)](https://contensis.slack.com)

Create a Contensis client that allows you to query and retrieve entries, site view nodes, content types and projects. It can be used in all your JavaScript / TypeScript projects, whether it runs in a browser, Node.js app, or both.

[**Explore the docs on contensis.com**](https://www.contensis.com/help-and-docs/apis/delivery-js) and the [contensis-delivery-api-examples](https://github.com/contensis/contensis-delivery-api-examples) repository containing Express.js, React and Angular test applications, as well as an extended example using nodes api in a Node.js project.

Use with Contensis version 12.0 and above. For Contensis 11.3 support use [this version](https://github.com/contensis/contensis-delivery-api/tree/release/1.0) | [npm](https://www.npmjs.com/package/contensis-delivery-api/v/1.0.0). This library requires Node.js 14 or above.

## Installation

Install the package to your project `dependencies` using npm, or your preferred Node.js package manager.

```shell
npm install --save contensis-delivery-api
```

## Usage

Follow the examples with the preferred coding style that best suits your project

### Create a client

All of the delivery methods are available under the `client` instance returned by `Client.create(...)`

Use the provided intellisense to guide you where it is available

```typescript
// Using TypeScript, or ES Module syntax

import { Client } from "contensis-delivery-api";

const client = Client.create({
  rootUrl: "https://my-cms.com",
  accessToken: "DELIVERY_API_ACCESS_TOKEN",
  projectId: "website",
  language: "en-GB",
  versionStatus: "published",
});
```

```cjs
// Using Common JS syntax

const Client = require("contensis-delivery-api").Client;

const client = Client.create({
  rootUrl: "https://my-cms.com",
  accessToken: "DELIVERY_API_ACCESS_TOKEN",
  projectId: "website",
  language: "en-GB",
  versionStatus: "published",
});
```

### Get a list of entries

Reusing the `client` instance we created above

```typescript
// Using TypeScript, or ES Module syntax

const loadMovies = async () => {
  const movieList = await client.entries.list({
    contentTypeId: "movie",
    pageOptions: { pageIndex: 0, pageSize: 10 },
    order: ["-releaseDate"],
  });
  for (const movie of movieList.items) {
    console.log(movie);
  }
};

loadMovies();
```

### Create a client config and get a list of entries

Keep a common client configuration and create the delivery client when you need it

```typescript
// Using async / await syntax (avoiding callbacks)

// Import the additional "Config" type when using TypeScript
import { Client, Config } from "contensis-delivery-api";

// Remove ": Config" annotation when NOT using TypeScript
const contensisConfig: Config = {
  rootUrl: "https://my-cms.com",
  accessToken: "DELIVERY_API_ACCESS_TOKEN",
  projectId: "website",
  language: "en-GB",
  versionStatus: "published",
};

const loadMovies = async () => {
  const client = Client.create(contensisConfig);
  const movieList = await client.entries.list({
    contentTypeId: "movie",
    pageOptions: { pageIndex: 0, pageSize: 10 },
    order: ["-releaseDate"],
  });
  for (const movie of movieList.items) {
    console.log(movie);
  }
};

loadMovies();
```

```typescript
// Using Promises and callbacks

import { Client } from "contensis-delivery-api";

const contensisConfig = {
  rootUrl: "https://my-cms.com",
  accessToken: "DELIVERY_API_ACCESS_TOKEN",
  projectId: "website",
  language: "en-GB",
  versionStatus: "published",
};

function loadMovies() {
  const client = Client.create(contensisConfig);
  client.entries
    .list({
      contentTypeId: "movie",
      pageOptions: { pageIndex: 0, pageSize: 10 },
      order: ["-releaseDate"],
    })
    .then((movieList) => {
      console.log(movieList.items);
    });
}

loadMovies();
```

_For more examples refer to our [documentation on contensis.com](https://www.contensis.com/help-and-docs/apis/delivery-js)_

## Fetch API

This library uses the `fetch` API and relies on it being available at runtime.

### Browser support

In modern browsers `fetch` is available natively, a polyfill is provided for older browsers.

The build of the library that targets browsers can be found in the `bundle` folder.

### Node.js support

When using this library in Node.js the `fetch` API is already polyfilled with [`cross-fetch`](https://www.npmjs.com/package/cross-fetch) package (which uses [`node-fetch`](https://www.npmjs.com/package/node-fetch) when used with a Node.js runtime).

Node.js [version 16](https://nodejs.org/docs/latest-v16.x/api/globals.html#fetch) introduced experimental support for a native global `fetch` API and shipped as standard with Node.js versions [18](https://nodejs.org/docs/latest-v18.x/api/globals.html#fetch) and [20](https://nodejs.org/docs/latest-v20.x/api/globals.html#fetch). The global `fetch` support in Node.js [version 21](https://nodejs.org/docs/latest-v21.x/api/globals.html#fetch) and greater is marked as stable.

### Use your own fetch

You can override the built-in fetch API by providing your own `fetchFn` method when creating the Client.

Method calls that require fetch invoked from this client instance will be made using your chosen API.

```typescript
import { Client } from "contensis-delivery-api";
import enterpriseFetch from "enterprise-fetch";

const client = Client.create({
  rootUrl: "https://my-cms.com",
  accessToken: "DELIVERY_API_ACCESS_TOKEN",
  projectId: "website",
  language: "en-GB",
  versionStatus: "published",
  fetchFn: enterpriseFetch,
});
```

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