Skip to content

Media Storage

Kyro CMS includes a robust media management system. It allows you to define collections that handle file uploads, extract metadata, and store files locally or on cloud providers.

The Upload Field

To allow file uploads in any standard collection, use the upload field type:

typescript
import { defineKyroConfig } from "@kyro-cms/core";

export default defineKyroConfig({
  collections: {
    documents: {
      slug: "documents",
      fields: [
        { name: "title", type: "text", required: true },
        { name: "file", type: "upload" },
      ],
    },
  },
});

For managing a shared image library used across multiple collections, use a dedicated Media Collection.

Media Collections

Kyro provides a pre-built media collection template:

typescript
import { defineKyroConfig, mediaCollections } from "@kyro-cms/core";

export default defineKyroConfig({
  collections: [
    ...mediaCollections, // Injects 'media' and 'folders' collections
  ],
});

When you use mediaCollections, the Admin UI automatically gains a "Media Library" tab, and any relationship field pointing to media opens a media picker modal.

Storage Providers

By default, files are stored on the local filesystem in /public/uploads. For production, you can configure cloud storage via the admin Settings → Storage Settings page.

Changing the Storage Provider

  1. Go to Settings → Storage Settings in the admin dashboard
  2. Select your provider: Local, AWS S3, Cloudflare R2, Cloudinary, or FTP
  3. Fill in the required credentials and configuration
  4. Save — the new provider takes effect immediately

The following providers are built in:

ProviderTypeDescription
LocallocalFilesystem storage (default)
AWS S3awsAmazon S3-compatible object storage
Cloudflare R2r2S3-compatible with Cloudflare's global network
Google Cloud StoragegcsGCS S3-compatible gateway
DigitalOcean SpacesdigitaloceanS3-compatible Spaces
Backblaze B2backblazeS3-compatible B2 Cloud Storage
WasabiwasabiS3-compatible hot cloud storage
CloudinarycloudinaryCloudinary image management
FTP/SFTPftpFTP and SFTP servers

How It Works

When a storage provider is configured:

  • New uploads are streamed directly to the provider
  • Existing files remain at their original location

Released under the MIT License.