Connect Cloudflare R2 to your Goodspeed app
Binary-safe object storage for user-generated media, app assets, and exports, accessed from Supabase Edge Functions with zero egress fees. Goodspeed wires Cloudflare R2 into every app that needs it at generation time, so you start with a working integration, not a blank config and a documentation tab.
WHAT GETS WIRED IN
Built into every Cloudflare R2 build
Every app Goodspeed generates with Cloudflare R2 includes these wired integrations from the first build. No manual setup required.
| Item | Description | Strength |
|---|---|---|
| R2 bucket credentials stored as Supabase secrets (R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY) and never exposed to the app bundle | R2 bucket credentials stored as Supabase secrets (R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY) and never exposed to the app bundle | 01 |
| lib/media.ts uses the S3-compatible R2 API to upload user profile photos and user-generated content from Edge Functions | lib/media.ts uses the S3-compatible R2 API to upload user profile photos and user-generated content from Edge Functions | 02 |
| Binary-safe upload pipeline uses base64 encoding for all binary blobs to prevent corruption across UTF-8 JSON boundaries | Binary-safe upload pipeline uses base64 encoding for all binary blobs to prevent corruption across UTF-8 JSON boundaries | 03 |
| Pre-signed URLs generated server-side for time-limited client access to private media assets | Pre-signed URLs generated server-side for time-limited client access to private media assets | 04 |
| RLS-equivalent access control enforced at the Edge Function layer so users can only read and write their own objects | RLS-equivalent access control enforced at the Edge Function layer so users can only read and write their own objects | 05 |
Source: gas-template repository · object-storage
REAL GENERATED CODE
A snippet from a Cloudflare R2 integration the pipeline ships
This pattern comes directly from the gas-template codebase. The studio generates Cloudflare R2 integration code like this for every app that includes it, not a placeholder you have to fill in yourself.
Binary-safe R2 upload
// supabase/functions/upload-media/handler.ts const r2 = new S3Client({ region: 'auto', endpoint: `https://${ACCOUNT_ID}.r2.cloudflarestorage.com`, credentials: { accessKeyId: Deno.env.get('R2_ACCESS_KEY_ID')!, secretAccessKey: Deno.env.get('R2_SECRET_ACCESS_KEY')!, }, }); async function uploadBinary(key: string, body: Uint8Array) { await r2.send(new PutObjectCommand({ Bucket: BUCKET, Key: key, Body: body })); }
Today's log
APPS THAT USE CLOUDFLARE R2
Where this integration ships
These app types include Cloudflare R2 as part of the generated stack. Each link goes to a full spec page with capabilities, scored ideas, and a pipeline walkthrough.
- Build a Social App appBuilding a social app from scratch means solving hard infrastructure problems: real-time feeds, fan-out writes, notification delivery, and content moderation hooks. Goodspeed generates a complete sociSOCIAL APP
- Build a Marketplace App appMarketplace apps require buyer and seller flows, search with filters, secure checkout, and the kind of review system that builds trust over time. Goodspeed generates all four, wired together on SupabaMARKETPLACE APP
- Build a On-Demand Service appOn-demand service apps require two-sided logistics: customer booking, provider dispatch, live location sharing, and payment settlement. Goodspeed generates all four sides as a native React Native app ON-DEMAND SERVICE APP
START WITH CLOUDFLARE R2