Media & Assets
Contensa.ai includes a built-in Media Library for uploading, organizing, and serving images, videos, PDFs, and other files. Media assets are stored on S3 and served via CDN.
Supported File Types
🖼️
Images
JPG, PNG, GIF, WebP, SVG
🎥
Video
MP4, WebM, MOV
📄
Documents
PDF, DOCX, XLSX
🎵
Audio
MP3, WAV, OGG
Uploading Media
Via Dashboard
- 1
Navigate to Media in your project sidebar.
- 2
Click Upload or drag and drop files into the upload area.
- 3
Add optional metadata: alt text, title, and tags.
- 4
Click Upload. Files are stored on S3 and a CDN URL is generated.
Via API
bash
curl -X POST https://api.mybe.app/api/v1/projects/{projectId}/media \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@/path/to/image.jpg" \
-F "alt=My image description" \
-F "title=Hero Image"Via SDK
typescript
import { createClient } from '@mybe/sdk';
const client = createClient({
projectId: 'your-project-id',
apiKey: process.env.CONTENSA_API_KEY,
});
// Upload a file
const asset = await client.media.upload(file, {
alt: 'Hero image for homepage',
title: 'Homepage Hero',
});
console.log(asset.url);
// https://cdn.mybe.app/projects/abc/media/hero.jpgFetching Media
typescript
// List all media assets
const assets = await client.media.list({ limit: 20, page: 1 });
// Get a single asset by ID
const asset = await client.media.get('asset_abc123');
// Delete an asset
await client.media.delete('asset_abc123');Media Asset Object
When you fetch a media asset, you receive an object with the following shape:
json
{
"id": "asset_abc123",
"url": "https://cdn.mybe.app/projects/abc/media/hero.jpg",
"filename": "hero.jpg",
"mimeType": "image/jpeg",
"size": 204800,
"width": 1920,
"height": 1080,
"alt": "Hero image for homepage",
"title": "Homepage Hero",
"createdAt": "2024-01-15T10:30:00Z"
}Storage Limits by Plan
| Plan | Storage | Max File Size |
|---|---|---|
| Free Trial | 500 MB | 10 MB |
| Starter | 5 GB | 50 MB |
| Pro | 50 GB | 200 MB |
| Enterprise | Unlimited | 1 GB |