Storage overview
Comwit Storage is a project-owned object bucket backed by Cloudflare R2. You create it as its own resource, then connect any server-side application that speaks the S3 API. You do not install a Comwit-specific storage package.
One Storage resource has four important values:
| Value | Purpose |
|---|---|
storage_id | Stable Comwit resource id, such as stg_6f9a… |
bucket | Exact globally unique S3 bucket name you selected |
endpoint | Authenticated S3 endpoint: https://storage.cloud.comwit.io |
public_base_url | Optional direct public object URL under *.comwit.link |
Control plane and data plane
Section titled “Control plane and data plane”Storage has two deliberately separate paths.
Create/configure:CLI, console, or JSON API -> platform-api -> Comwit Storage resource + R2
Private object traffic:server-side S3 client -> storage.cloud.comwit.io -> authenticated gateway -> R2
Private browser transfer:app server -> platform-api presign -> browser -> R2 (provider CORS)
Public object traffic:browser -> stg-*.comwit.link -> Cloudflare Cache -> R2Creating or deleting a bucket and enabling public delivery are control-plane operations. Uploading, downloading, listing, and multipart operations use a normal S3 client. Public reads bypass the S3 gateway and Comwit runtime.
Authentication
Section titled “Authentication”Use the existing Comwit token classes:
cwt_personal token for local tools and developer automation;cwp_project token for a deployed service.
Read/list/head operations require storage:read. Object mutations and Storage
lifecycle changes require storage:write. There is no separate cws_ token and
Comwit never gives an application Cloudflare credentials.
What is S3-compatible?
Section titled “What is S3-compatible?”The gateway accepts the S3 operations supported by the backing R2 compatibility
surface, including normal object reads/writes and multipart uploads. It does not
promise every AWS-only S3 feature. Bucket creation and deletion remain Comwit
resource operations, and ListBuckets is filtered to the caller’s authorized
projects.