| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| @vercel_blob@2.0.0 source code.tar.gz | 2025-09-16 | 90.4 MB | |
| @vercel_blob@2.0.0 source code.zip | 2025-09-16 | 90.5 MB | |
| README.md | 2025-09-16 | 2.2 kB | |
| Totals: 3 Items | 180.9 MB | 0 | |
Major Changes
-
0b8ead9: BREAKING CHANGE:
To continue receiving
onUploadCompletedcallback once a file is uploaded with Client Uploads when not hosted on Vercel, you need to provide thecallbackUrlat theonBeforeGenerateTokenstep when usinghandleUpload.When hosted on Vercel: No code changes required. The
callbackUrlis inferred from Vercel system environment variables:- In preview environment:
VERCEL_BRANCH_URLwhen available, otherwiseVERCEL_URL - In production environment:
VERCEL_PROJECT_PRODUCTION_URL
If you're not hosted on Vercel or you're not using Vercel system environment variables, your will need to provide the
callbackUrl:Before:
ts await handleUpload({ body, request, onBeforeGenerateToken: async (pathname) => { /* options */ }, onUploadCompleted: async ({ blob, tokenPayload }) => { /* code */ }, });After:
ts await handleUpload({ body, request, onBeforeGenerateToken: async (pathname) => { return { callbackUrl: 'https://example.com' }; // the path to call will be automatically computed }, onUploadCompleted: async ({ blob, tokenPayload }) => { /* code */ }, });For local development: Set the
VERCEL_BLOB_CALLBACK_URLenvironment variable to your tunnel URL:bash VERCEL_BLOB_CALLBACK_URL=https://abc123.ngrok-free.appSee the updated documentation at https://vercel.com/docs/vercel-blob/client-upload to know more.
Details:
Before this commit, during Client Uploads, we would infer the
callbackUrlat the client side level (browser) based onlocation.href(for convenience). This is wrong and allows browsers to redirect the onUploadCompleted callback to a different website.While not a security risk, because the blob urls are already public and the browser knows them, it still pose a risk of database drift if you're relying on onUploadCompleted callback to update any system on your side.
- In preview environment: