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

# Cloudflare R2

> R2 as the user's external storage.

# Cloudflare R2

R2 is compatible with S3's API. You can generate a signed URL with the SDK of AWS pointing to the R2 endpoint.

```ts theme={null}
const client = new S3Client({
  region: "auto",
  endpoint: `https://${process.env.CF_ACCOUNT_ID}.r2.cloudflarestorage.com`,
  credentials: {
    accessKeyId: process.env.R2_ACCESS_KEY_ID!,
    secretAccessKey: process.env.R2_SECRET_ACCESS_KEY!
  }
});
```

Then use `/convert/from-url` the same as with S3.

The API does not need its own R2. If the user already has R2, S3, or Supabase, they only receive a temporary URL.
