modules/media · npm: @86d-store/media
Installation
config.json:
Configuration
Maximum file size in bytes. Defaults to 10 MB (10485760). This value is a string for module config compatibility.
Comma-separated list of allowed MIME types. Defaults to all types when omitted. Example:
"image/png,image/jpeg,image/webp,video/mp4".File upload
Upload files through the shared Store Runtime upload endpoint, not through the Media Module’s own endpoints. The upload endpoint is admin-only.
Supported file types and size limits:
After uploading, create an asset record via the admin API to register the file URL in the media library.
Store endpoints
Store endpoints are read-only and publicly accessible.Admin endpoints
Admin endpoints require authentication.Assets
Folders
Components
Add these components to your MDX Template files. Themedia Module must be listed in config.json.
ImageDisplay
Displays a single image asset by ID. Fetches the asset, renders it with proper alt text, and optionally shows a caption.
ImageDisplay for hero images, content blocks, or anywhere you need to render a single managed image.
MediaGallery
Filterable grid of media assets. Images render as thumbnails, videos show a poster frame with a play overlay, and other file types display a label. Supports pagination and item selection. Fetches its own data.
MediaGallery on gallery pages, lookbook sections, or anywhere you want a browsable media grid.
VideoPlayer
Embedded HTML5 video player. Fetches a video asset by ID and renders it with native browser controls.
VideoPlayer for product demo videos, promotional content, or tutorial sections.
Types
Notes
- Folders support nesting via
parentId. UseGET /admin/media/folders?parentId=folder_id_hereto list a folder’s children. - Tags are stored as a JSON string array. You can filter by one tag at a time using the
tagquery parameter. bulkDeleteandmoveAssetsaccept arrays of asset IDs, so one call can delete or move a whole batch.getStats()returns totals broken down by MIME type and folder, useful for storage reporting.