Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 2.01 KB

File metadata and controls

38 lines (29 loc) · 2.01 KB

Helix Mediahandler Library

Library for interacting with the helix media-bus

Status

codecov CircleCI GitHub license GitHub issues LGTM Code Quality Grade: JavaScript semantic-release

Installation

MediaHandler no longer talks to S3/R2 directly — the caller passes in a storageBucket (a Bucket from @adobe/helix-shared-storage) bound to the media bus, constructed with whichever storage backend package is appropriate (e.g. @adobe/helix-shared-storage-s3 for S3+R2). Storage credentials, backend selection, and R2 mirroring are entirely the caller's responsibility — see that package's own environment variable documentation.

$ npm install @adobe/helix-mediahandler
import { StorageS3 } from '@adobe/helix-shared-storage-s3';
import { MediaHandler } from '@adobe/helix-mediahandler';

const storageBucket = StorageS3.fromContext(context).mediaBus();
const mediaHandler = new MediaHandler({
  owner, repo, ref, contentBusId, storageBucket,
});

API Reference

see API Documentation