[wip]
Summary
Adds a direct-to-GCS resumable upload path for the Clips recorder, allowing the browser to PUT video chunks straight to GCS via a resumable session URI — bypassing the per-chunk app-server hop.
Problem
Previously, every video chunk recorded in the browser was routed through the app server before reaching GCS/Builder.io storage. This added unnecessary latency and load on the server for each chunk during upload.
Solution
When BUILDER_PRIVATE_KEY is configured, the server initiates a GCS resumable session and returns the session URI to the browser. The browser then PUTs chunks directly to GCS using Content-Range headers. After all chunks are uploaded, the browser calls a completion endpoint that registers the asset with Builder.io and finalizes the recording row.
Key Changes
packages/core/src/file-upload/builder.ts: AddedrequestBuilderResumableSession()to initiate a GCS resumable upload session via the Builder.io/api/v1/upload/signed-url?isResumable=trueendpoint, andcompleteBuilderResumableUpload()to register the completed upload and retrieve the CDN URL.packages/core/src/file-upload/index.ts: Exported the two new functions and theBuilderResumableSessiontype.templates/clips/server/routes/api/uploads/[recordingId]/init-resumable.post.ts: New route (POST /api/uploads/:recordingId/init-resumable) that authenticates the user, validates the request, and returns aresumableSessionUri+assetIdfor the browser to use.templates/clips/server/routes/api/uploads/[recordingId]/complete.post.ts: New route (POST /api/uploads/:recordingId/complete) that callscompleteBuilderResumableUpload()and then invokesfinalizeRecordingwith the resulting CDN URL, skipping chunk assembly entirely.templates/clips/actions/create-recording.ts: ReturnssupportsResumableUpload: truewhenBUILDER_PRIVATE_KEYis set, signaling to the frontend that the direct upload path is available.templates/clips/actions/finalize-recording.ts: AddedvideoUrlandvideoSizeBytesinput fields; whenvideoUrlis provided, chunk assembly and server-side upload are skipped and the recording is marked ready immediately.templates/clips/app/routes/record.tsx: PassesuseResumableUploadflag to the recorder engine based on thesupportsResumableUploadflag returned from recording creation.
To clone this PR locally use the Github CLI with command gh pr checkout 1462
You can tag me at @builderio for anything you want me to fix or change
Deploy Preview for agent-native-voice ready!
| Name | Link |
|---|---|
| Latest commit | 1147d37ed09375e4c4c00c4ce4c489b1754d41a8 |
| Latest deploy log | https://app.netlify.com/projects/agent-native-voice/deploys/6a3c4e066ec5220008f55271 |
| Deploy Preview | https://deploy-preview-1462--agent-native-voice.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
| Make changes | Run an agent on this branch |
To edit notification comments on pull requests, go to your Netlify project configuration.
Deploy Preview for agent-native-brain ready!
| Name | Link |
|---|---|
| Latest commit | 1147d37ed09375e4c4c00c4ce4c489b1754d41a8 |
| Latest deploy log | https://app.netlify.com/projects/agent-native-brain/deploys/6a3c4e06ef1b670008079944 |
| Deploy Preview | https://deploy-preview-1462--agent-native-brain.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
| Make changes | Run an agent on this branch |
To edit notification comments on pull requests, go to your Netlify project configuration.
Deploy Preview for agent-native-meeting-notes ready!
| Name | Link |
|---|---|
| Latest commit | 1147d37ed09375e4c4c00c4ce4c489b1754d41a8 |
| Latest deploy log | https://app.netlify.com/projects/agent-native-meeting-notes/deploys/6a3c4e06ccdac40008ba4e39 |
| Deploy Preview | https://deploy-preview-1462--agent-native-meeting-notes.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
| Make changes | Run an agent on this branch |
To edit notification comments on pull requests, go to your Netlify project configuration.
Deploy Preview for agent-native-scheduling ready!
| Name | Link |
|---|---|
| Latest commit | 1147d37ed09375e4c4c00c4ce4c489b1754d41a8 |
| Latest deploy log | https://app.netlify.com/projects/agent-native-scheduling/deploys/6a3c4e06bead230008bb686a |
| Deploy Preview | https://deploy-preview-1462--agent-native-scheduling.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
| Make changes | Run an agent on this branch |
To edit notification comments on pull requests, go to your Netlify project configuration.
Deploy Preview for agent-native-images ready!
| Name | Link |
|---|---|
| Latest commit | 1147d37ed09375e4c4c00c4ce4c489b1754d41a8 |
| Latest deploy log | https://app.netlify.com/projects/agent-native-images/deploys/6a3c4e0633f0f3000879dd32 |
| Deploy Preview | https://deploy-preview-1462--agent-native-images.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
| Make changes | Run an agent on this branch |
To edit notification comments on pull requests, go to your Netlify project configuration.
Deploy Preview for agent-native-design ready!
| Name | Link |
|---|---|
| Latest commit | 1147d37ed09375e4c4c00c4ce4c489b1754d41a8 |
| Latest deploy log | https://app.netlify.com/projects/agent-native-design/deploys/6a3c4e0633f0f3000879dd30 |
| Deploy Preview | https://deploy-preview-1462--agent-native-design.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
| Make changes | Run an agent on this branch |
To edit notification comments on pull requests, go to your Netlify project configuration.