# @prezly/sdk

> Prezly API SDK

Latest version **26.15.0** (published 2026-09-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @prezly/sdk
pnpm add @prezly/sdk
yarn add @prezly/sdk
bun add @prezly/sdk
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 26.15.0 |
| Published | 2026-09-23 |
| First published | 2019-11-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22 |
| Dependencies | 3 |
| Unpacked size | 478.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Prezly Team |
| Maintainers | digitalbase, francis-prezly, prezlynpm, jessewynants, patrycja_prezly |

## Links

- npm: https://www.npmjs.com/package/@prezly/sdk
- Repository: https://github.com/prezly/prezly
- Homepage: https://github.com/prezly/prezly#readme
- Issues: https://github.com/prezly/prezly/issues
- npm.io page: https://npm.io/package/@prezly/sdk

## Dependencies (3)

- [query-string](https://npm.io/package/query-string.md) ^6.14.1
- [@prezly/uploads](https://npm.io/package/@prezly/uploads.md) ^0.3.2
- [@prezly/progress-promise](https://npm.io/package/@prezly/progress-promise.md) ^2.0.1

## Recent versions

- 26.15.0 (latest) — 2026-09-23
- 26.3.0-0 (next) — 2026-02-26
- 26.14.0 — 2026-09-16
- 26.8.0 — 2026-08-25
- 26.7.0 — 2026-08-25
- 26.6.2 — 2026-08-12
- 26.6.1 — 2026-08-10
- 26.6.0 — 2026-08-07
- 26.5.1 — 2026-06-09
- 26.5.0 — 2026-05-27
- 26.4.0 — 2026-05-07
- 26.3.3 — 2026-04-22
- 26.3.1 — 2026-03-17
- 26.3.0 — 2026-02-26
- 26.2.1 — 2026-02-17
- … 359 more at https://npm.io/package/@prezly/sdk/versions

## README

## Prezly JavaScript SDK

### Getting started

```sh
npm install --save @prezly/sdk
# or yarn
yarn add @prezly/sdk
```

### Using the code

Using ES Modules:

```js
import { createPrezlyClient } from '@prezly/sdk';

const prezlyClient = createPrezlyClient({
    accessToken: 'your-access-token',
});
```

Or Using CommonJS:

```js
const { createPrezlyClient } = require('@prezly/sdk').default;

const prezlyClient = createPrezlyClient({
    accessToken: 'your-access-token',
});
```

## Requirements

### API token

At this moment, the UI does not support issuing API tokens. Please contact support to issue one for you.

### [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) API support

`@prezly/sdk` is using `fetch` to create requests. We assume that the environment running the code supports it.

We understand that some of the environments, such as node.js or old browsers, do not support `fetch`. This can be resolved by including a polyfill.

#### Polyfilling in browsers using [`whatwg-fetch`](https://www.npmjs.com/package/whatwg-fetch)

```sh
npm install --save whatwg-fetch
# or yarn
yarn add whatwg-fetch
```

```js
import 'whatwg-fetch';
// ...
import { createPrezlyClient } from '@prezly/sdk';
```

We recommend referring to the [official `whatwg-fetch` module documentation](https://www.npmjs.com/package/whatwg-fetch) for more information.

#### Polyfilling in browsers using [`node-fetch`](https://www.npmjs.com/package/node-fetch)

```sh
npm install --save node-fetch
# or yarn
yarn add node-fetch
```

```js
global.fetch = require('node-fetch');
// ...
const { createPrezlyClient } = require('@prezly/sdk');
```

We recommend referring to the [official `node-fetch` module documentation](https://www.npmjs.com/package/node-fetch) for more information.

#### Platform-agnostic polyfill using [`cross-fetch`](https://www.npmjs.com/package/cross-fetch)

```sh
npm install --save cross-fetch
# or yarn
yarn add cross-fetch
```

Using ES Modules:

```js
import 'cross-fetch/polyfill';
// ...
import { createPrezlyClient } from '@prezly/sdk';
```

Or Using CommonJS:

```js
require('cross-fetch/polyfill');
// ...
const { createPrezlyClient } = require('@prezly/sdk');
```

We recommend referring to the [official `cross-fetch` module documentation](https://www.npmjs.com/package/cross-fetch) for more information.

#### Custom `fetch` implementation

Additionally, you can initialize the API client with your own implementation of `fetch`:

```js
import { createPrezlyClient } = from '@prezly/sdk';

const prezlyClient = createPrezlyClient({
    accessToken: 'your-access-token',
    fetch: customFetch,
});
```

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