Skip to content

Cloud Storage

For cloud storage, WeaveAI uses Cloudflare R2, which is S3-compatible object storage. To integrate cloud storage, please follow the steps below.

This bucket will be used to store all AI generated content from users such as images, videos, and audio. Everything in this bucket is protected via Signed URLs.

  1. Go to Cloudflare
  2. Sign up or log in to your account
  3. From the menu on the left, under Build, navigate to Storage & databasesR2 object storageOverview
  4. Click on Create bucket
    • Bucket name: name your bucket
    • Location: Automatic
    • Default Storage Class: Standard
  5. Click Create bucket
  6. Take a note of the bucket name

This bucket will be used to store your site’s branding files like logos and favicon. The process of creating the bucket is the same as the first one, so follow the same guide above to create a second bucket. Once you’ve created the bucket, you need to make it public, please follow the steps below.

  1. Navigate to the second bucket you created, and go to Settings
  2. Under Custom Domains, click Add
  3. Add your domain (e.g. branding.your-domain.com) and click Continue
    • In order to make a bucket public, you need to associate a domain with it, and your domain must be added to Cloudflare beforehand
    • Alternatively, you can click Enable on Public Development URL in order to make the bucket public, and use the domain URL from Cloudflare instead
  4. Click Connect domain
  5. The bucket is now publicly available. Take a note of the:
    • Public bucket URL (e.g. branding.your-domain.com)
    • Public bucket name

Once you’ve created the two buckets, you will need to create an API token in order to be able to access them.

  1. Go back to the R2 object storageOverview section
  2. Find API Tokens on your screen and click on Manage
  3. Click Create Account API token
    • Token name: name your token e.g. R2 Token for WeaveAI buckets
    • Permissions: Object Read & Write: Allows the ability to read, write, and list objects in specific buckets.
    • Specify bucket: Select Apply to specific buckets only and select the two buckets you created in the previous steps
    • TTL: Forever
  4. Click Create Account API Token
  5. Save the following parameter values:
    • Access Key ID
    • Secret Access Key
  6. Go back to the R2 object storageOverview section, and copy your Account ID

Add the values to the WeaveAI admin dashboard

Section titled “Add the values to the WeaveAI admin dashboard”
  1. Now that we successfully created the bucket and the access token, you should have the following information:
    • Account ID
    • Access Key ID
    • Secret Access Key
    • Bucket Name - the name of the bucket you created first
    • Branding Bucket Name - the name of the public bucket
    • Branding Public URL - https://branding.your-domain.com or https://pub-*.r2.dev
  2. Add each key to its respective field in the Admin DashboardSite SettingsCloud Storage section