SETUP GUIDES · FILE STORAGE

Cloudflare R2 bucket

Store your app’s files in Cloudflare R2, with no download fees.

⏱ About 10 minutes

Cloudflare R2 works like Amazon S3 but does not charge for downloads. You create a bucket and an API token that can only read and write that one bucket.

Words you’ll see

Bucket
A storage container for files at a storage provider, like a top-level folder in the cloud. Your app’s uploads go into it.
Access key ID and secret access key
A pair of values that works like a username and password for programs. The ID can be shown; the secret is shown once when you create it.
Endpoint
The web address Claspine uses to reach your storage provider, such as https://s3.us-east-1.amazonaws.com.
Signed URL
A web link that allows one upload or download for a few minutes. Claspine creates these so files travel directly between your users and your bucket without passing through Claspine.
CORS
A browser safety setting on the bucket that says which websites may upload or download directly. Without it, browsers block uploads from your app.

Steps

  1. In the Cloudflare dashboard open R2 Object Storage and click Create bucket.
  2. Open Manage R2 API Tokens → Create API token.
  3. Set permission to Object Read & Write and choose Apply to specific buckets only → your bucket. Create the token.
  4. Copy the Access Key ID, the Secret Access Key and the S3 address shown (https://<ACCOUNT_ID>.r2.cloudflarestorage.com).
  5. Open your bucket → Settings → CORS policy and allow PUT and GET from your app’s web address.
  6. Open the Claspine console, choose your project and go to File Storage.
  7. Pick this provider in the list, then fill in the fields as shown in “What goes where in Claspine” below.
  8. Click Save & test. Claspine writes one tiny test file into your bucket, reads it back and deletes it. A green result means everything is connected.

What goes where in Claspine

Console fieldValue
ENDPOINThttps://<ACCOUNT_ID>.r2.cloudflarestorage.com
REGIONauto
ACCESS KEY ID / SECRETFrom the token in step 4.

Keep it safe

  • A token limited to one bucket cannot read or delete anything else in your Cloudflare account.

Claspine stores the values encrypted, never shows them again in full, and never sends them to your app or SDK.

← All setup guides