6.0.0 • Published 1 year ago

@contentchef/contentchef-media v6.0.0

Weekly downloads
16
License
MIT
Repository
github
Last release
1 year ago

Install

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
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);
6.0.0

1 year ago

5.0.3

2 years ago

5.0.2

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

5.0.0-alpha.2

2 years ago

5.0.0-alpha.1

2 years ago

5.0.0-alpha.0

2 years ago

4.0.1

3 years ago

4.0.0

3 years ago

4.0.3

3 years ago

4.0.2

3 years ago

3.0.1

4 years ago

3.0.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago