---
title: Media
description: Media libraries in the repo, in S3 or Cloudflare R2, or as external links.
---

## Library types

**Repo folder**

Files committed to the repo, in `public/` or `src/`. Pick a link style: site path, folder-relative, CDN or custom. Set size and type limits.

**S3 / R2 bucket**

Uses a workspace integration (Settings → Integrations). Uploads go straight to the bucket; the picker lists it page by page. Size and type limits apply.

**External URLs**

Editors paste links. You can limit them to a prefix, like `https://cdn.example.com/`.

The image picker in the entry editor has one tab per library and can upload to buckets.

## The library screen

- **Size** comes from the git tree, the **date** from the last commit.
- **Used in** lists the content entries and source files that mention the file name.
- **Title, alt text, caption and credit** are kept in the database, not committed.
- **Move, convert to WebP, replace, crop and clean up** are each one commit. Moving a file rewrites its references (`/images/x.png` or relative paths; not `@/` aliases).

:::note
Bucket credentials are encrypted with a key derived from `BETTER_AUTH_SECRET`. Changing that secret means adding the integrations again.
:::

:::warning[Not yet]
Media tags and size variants (thumbnail, medium, large) are not supported: Astro builds sizes at build time, so the library shows the original.
:::
