# @contentchef/contentchef-media

> Package for helping managing media with ContentChef

Latest version **8.0.0** (published 2026-06-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @contentchef/contentchef-media
pnpm add @contentchef/contentchef-media
yarn add @contentchef/contentchef-media
bun add @contentchef/contentchef-media
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 8.0.0 |
| Published | 2026-06-11 |
| First published | 2020-06-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 4 |
| Author | ContentChef |
| Maintainers | bcoders, apalumbo |

## Links

- npm: https://www.npmjs.com/package/@contentchef/contentchef-media
- Repository: https://github.com/ContentChef/contentchef-node
- Issues: https://github.com/ContentChef/contentchef-node/issues
- npm.io page: https://npm.io/package/@contentchef/contentchef-media

## Dependencies (2)

- [@cld-apis/types](https://npm.io/package/@cld-apis/types.md) ^0.1.3
- [cloudinary-build-url](https://npm.io/package/cloudinary-build-url.md) ^0.2.4

## Recent versions

- 8.0.0 (latest) — 2026-06-11
- 9.0.0-beta.2 (beta) — 2026-09-16
- 9.0.0-alpha.2 (alpha) — 2026-07-03
- 9.0.0-beta.1 — 2026-07-03
- 9.0.0-alpha.1 — 2026-07-02
- 7.0.0 — 2026-06-11
- 7.0.0-beta.4 — 2026-06-03
- 7.0.0-beta.3 — 2026-06-03
- 6.0.0 — 2023-01-09
- 5.0.3 — 2022-01-20
- 5.0.2 — 2022-01-19
- 5.0.1 — 2022-01-19
- 5.0.0 — 2022-01-19
- 5.0.0-alpha.2 — 2021-12-20
- 5.0.0-alpha.1 — 2021-12-17
- … 8 more at https://npm.io/package/@contentchef/contentchef-media/versions

## README

### Install

```bash
npm install @contentchef/contentchef-media
# or alternatively with yarn
yarn @contentchef/contentchef-media
```

### Usage

This package provides methods to help you manage and interact with ContentChef's media

* `createUrl` helps you generate a proper url given a media publicId
* `imageUrl` helps you create an url for an image given a media publicId
* `videoUrl` helps you create an url for a video given a media publicId
* `rawFileUrl` helps you create an url for a raw file (pdf, zip, ecc.) given a media publicId

```typescript
import { createUrl, imageUrl, videoUrl, rawFileUrl } from '@contentchef/contentchef-node';

const mediaPublicId = 'publicId';

const mediaUrl = createUrl(mediaPublicId);

const image = imageUrl(mediaPublicId);

const video = videoUrl(mediaPublicId);

const rawFile = rawFileUrl(mediaPublicId);

// If you'd like to pass transformations you can do so in the second argument of each method
const transformations = {
  height: 100,
  width: 200
}
const mediaUrl = createUrl(mediaPublicId, transformations);
```

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