mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
54 lines
1.8 KiB
Plaintext
54 lines
1.8 KiB
Plaintext
---
|
|
title: 'Media'
|
|
description: 'Effortlessly manage and serve all your media files.'
|
|
---
|
|
|
|
**bknd** provides a flexible and efficient way to handle media files, making it easy to upload, manage, and deliver content across various platforms.
|
|
|
|
### **Core Features**
|
|
- **File Uploads**: Supports direct (chunked coming soon) uploads of files up to 5GB (depending
|
|
on your environment).
|
|
- **Adapter-Based Design**:
|
|
- Pre-built support for S3, S3-compatible services (e.g., R2, Tigris), and Cloudinary.
|
|
- Extend functionality by implementing custom adapters.
|
|
- **Entity Integration**: Attach media files directly to entities for seamless data association.
|
|
- **Content Delivery**: Serve media over an API endpoint or directly from your provider.
|
|
|
|
The media tools are designed to integrate effortlessly into your workflows, offering scalability
|
|
and control without added complexity.
|
|
|
|
### Pre-built support for S3
|
|
|
|
There are two ways to enable S3 or S3 compatible storage in bknd.
|
|
|
|
1. Enable via the admin UI.
|
|
|
|
Simply navigate to the **Media** tab of the bknd admin UI and enable the S3 media support.
|
|
Enter your AWS S3-compatible storage Access Key, Secret Access Key, and URL.
|
|
This will automatically configure the S3 adapter for you.
|
|
|
|
2. Enable programatically.
|
|
|
|
To enable using a code-first approach, create an [Initial Structure](/usage/database#initial-structure) using the
|
|
`initialConfig` option in your `bknd.config.ts` file.
|
|
|
|
```typscript bknd.config.ts
|
|
import type { BkndConfig } from "bknd/adapter";
|
|
|
|
export default {
|
|
initialConfig: {
|
|
media: {
|
|
enabled: true,
|
|
adapter: {
|
|
type: "s3",
|
|
config: {
|
|
access_key: "<key>",
|
|
secret_access_key: "<secret key>",
|
|
url: "<bucket url>"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} satisfies BkndConfig;
|
|
```
|