How it works

The R2 connector pulls in all documents from the specified Cloudflare R2 bucket. It supports various file formats including PDF, DOC, DOCX, TXT, and more.

Documents are updated every 1 day.

Setting up

Authorization

  1. Log into your Cloudflare dashboard.
  2. Navigate to “R2” in the sidebar.
  3. Click on “Manage R2 API Tokens”.

Manage API

  1. Click “Create API token”.

Create API token

  1. Give your token a name (e.g., “DanswerR2Connector”) and select the appropriate permissions (Object Read only). Read only

  2. Click “Create API Token”.

  3. On the next screen, you’ll see your Access Key ID and Secret Access Key. Make sure to copy these immediately as you won’t be able to access the Secret Access Key again.

  4. To find your Account ID, go to the Overview page in your Cloudflare dashboard. The Account ID is listed in the url as the final substring.

Danswer page 1

Indexing

  1. Navigate to the Admin Dashboard and select the R2 Connector.
  2. In Step 1, provide your R2 credentials:

Danswer page 2

  • Provide your R2 Access Key ID, Secret Access Key, and Account ID for authentication.
  • These credentials will be used to access your R2 buckets.

R2 Access Key ID: R2 Secret Access Key: Account ID:

  1. Click “Update” to save your credentials.

  2. In Step 2, specify which R2 bucket you want to make searchable:

Danswer page 2

  1. Click “Connect” to begin indexing.

Understanding R2 Structure

Cloudflare R2 organizes data into buckets, similar to Amazon S3. Each bucket can contain an unlimited number of objects (files). You can think of a bucket as a root directory, and the objects as files within that directory.

For more information on R2 structure, visit the Cloudflare R2 documentation.