> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streamly.watch/llms.txt
> Use this file to discover all available pages before exploring further.

# Cloudflare R2 Plugin

> Cloudflare R2 object storage — account/bucket/keys, public base URL, and upload routes (not a playback source).

**Cloudflare R2** (`storage.cloudflare_r2`) is a Streamly **plugin** in the **storage** category.

R2 stores **media objects** (posters, branding, local uploads). Until R2 is fully configured, Streamly falls back to Supabase storage. R2 never appears in Catalog → Add source.

## Learn the service

Watch this overview of the vendor platform (helpful before you paste keys into Streamly).

<Frame caption="Getting started with R2 — Cloudflare Developers.">
  <iframe src="https://www.youtube.com/embed/TIp5sUZO4Uo" title="Getting started with R2" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowFullScreen />
</Frame>

## At a glance

| | |
| - | - |
| **Plugin ID** | `storage.cloudflare_r2` |
| **Capabilities** | `storage.objects`, `storage.uploads`, `storage.signed_urls` |
| **Fallback** | Supabase until configured |

## Capabilities

* `storage.objects`
* `storage.uploads`
* `storage.signed_urls`

## When to use it

* CDN-friendly posters & branding assets
* Local file uploads without filling Supabase

## How it works

Uploads from catalog media, branding, and blog routes go through the R2 plugin when credentials + public URL are valid.

Used by: `POST /api/v1/catalog/media`, `/api/operator/branding/media`, `/api/v1/blog/media`.

## Activation keys

Configure in `/admin/plugins` → **Cloudflare R2** → Configure. Secret fields stay server-side — never commit them or expose as `NEXT_PUBLIC_*` unless the key is intentionally public (e.g. Stripe publishable key).

| Key | Label | Required | Secret | Description | Docs |
| - | - | - | - | - | - |
| `accountId` | Account ID | Yes | No | Cloudflare account | [Find IDs](https://developers.cloudflare.com/fundamentals/account/find-account-and-zone-ids/) |
| `bucket` | Bucket name | Yes | No | R2 bucket | [Buckets](https://developers.cloudflare.com/r2/buckets/create-buckets/) |
| `accessKeyId` | Access key ID | Yes | Yes | R2 API token | [Tokens](https://developers.cloudflare.com/r2/api/tokens/) |
| `secretAccessKey` | Secret access key | Yes | Yes | Matching secret | [Tokens](https://developers.cloudflare.com/r2/api/tokens/) |
| `publicBaseUrl` | Public base URL | Yes | No | Prefer Public Development URL `pub-….r2.dev`. Do **not** paste `*.r2.cloudflarestorage.com`. Custom domains need working DNS. | [Public buckets](https://developers.cloudflare.com/r2/buckets/public-buckets/) |

## Setup guide

<Steps>
  <Step title="Create bucket">R2 → Create bucket.</Step>
  <Step title="Enable public URL">Bucket Settings → Public Development URL → copy into `publicBaseUrl`.</Step>
  <Step title="API token">Create R2 token with object R/W → paste keys.</Step>
  <Step title="Verify">Upload a poster in Catalog; confirm the URL uses your public base.</Step>
</Steps>

## Official vendor documentation

* [Create buckets](https://developers.cloudflare.com/r2/buckets/create-buckets/)
* [API tokens](https://developers.cloudflare.com/r2/api/tokens/)
* [Public buckets](https://developers.cloudflare.com/r2/buckets/public-buckets/)

## FAQ

<AccordionGroup>
  <Accordion title="NXDOMAIN on custom CDN host">
    DNS not attached yet — use the `pub-….r2.dev` development URL.
  </Accordion>

  <Accordion title="Still uploading to Supabase">
    One of the five keys is missing/wrong — re-save the plugin.
  </Accordion>

  <Accordion title="Can I play videos from R2 as a source?">
    Not as a Discover source. Use HLS URL sources or a video plugin for playback.
  </Accordion>
</AccordionGroup>

## Related

* [Catalog](/admin-dashboard/catalog)
* [Brand experience](/admin-dashboard/brand-experience)
* [Plugins Overview](/plugins/overview)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.