modules/media · npm: @86d-store/media
Installation
config.json:
Configuration
string
default:"\"10485760\""
Maximum file size in bytes. Defaults to 10 MB (10485760). This value is a string for module config compatibility.
string
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.
string
required
Asset ID to display.
string
CSS class applied to the container element.
boolean
default:"false"
When
true, renders the asset name as a caption below the image.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.
string
Filter assets by folder ID.
string
Filter by type:
"image", "video", or any MIME type prefix (e.g. "image/png").string
Filter assets by a single tag.
number
default:"12"
Number of items per page.
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.
string
required
Asset ID of the video to play.
boolean
default:"false"
Auto-play the video (muted) when it becomes visible in the viewport.
boolean
default:"false"
Loop playback continuously.
string
CSS class applied to the container element.
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.