Releases: vercel/storage
@vercel/[email protected]
Patch Changes
-
1dee5ab: Support Next.js v16 Cache Components even within
proxy.ts(fkamiddleware.ts) - see #890The
@vercel/edge-configv1.4.1 release added support for Next.js v16cacheComponents, but did not support using@vercel/edge-configin Next.js'sproxy.ts(fkamiddleware.ts) when thecacheComponentsflag was enabled innext.config.ts. This releases fixes this issue so@vercel/edge-configcan be used in any server side context in Next.js again.
@vercel/[email protected]
Patch Changes
- 309509c: Adjust README
@vercel/[email protected]
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. ThecallbackUrlis 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:
await handleUpload({ body, request, onBeforeGenerateToken: async (pathname) => { /* options */ }, onUploadCompleted: async ({ blob, tokenPayload }) => { /* code */ }, });
After:
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 theVERCEL_BLOB_CALLBACK_URLenvironment variable to your tunnel URL:VERCEL_BLOB_CALLBACK_URL=https://abc123.ngrok-free.app
See 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:
@vercel/[email protected]
Patch Changes
- f65d3c9: copy, head and del can receive a blob url or pathname, until now it was not very clear.
@vercel/[email protected]
Minor Changes
-
2b4acc3: feat(blob): Add support for custom headers in client upload method
This change adds the ability to pass custom headers to the
uploadmethod in the client, which will be forwarded to the server endpoint specified byhandleUploadUrl. This is particularly useful for sending authorization headers and solves issues like #796 and #420.
@vercel/[email protected]
Patch Changes
- d3627fa: Update Vercel Blob API endpoint to a more efficient one
@vercel/[email protected]
Patch Changes
- af5f54b: Add correct documentation to all exported methods
@vercel/[email protected]
Major Changes
-
00dfe23: Vercel Blob is now GA! To celebrate this we're releasing the
1.0.0version of the Vercel Blob SDK which includes multiple changes and improvements.Changes:
addRandomSuffixis now false by default- Blobs are cached for one month, configurable and with a lower limit of 1 min. Which means you cannot configure the blob cache to be less than 1 minute.
- Random suffixes are now also added to the
pathnameof blob responses andcontent-dispositionheader. - Overwriting blobs now requires to use
allowOverwrite: true. Example:
await put('file.png', file, { access: 'public' }); await put('file.png', file, { access: 'public' }); // This will throw put('file.png', file, { access: 'public', allowOverwrite: true }); // This will work
How to upgrade:
- If you're using random suffixes by default, then add
addRandomSuffix: truetoputandonBeforeGenerateTokenoptions. - If you're overwriting blobs, then add
allowOverwrite: truetoputandonBeforeGenerateTokenoptions. - If you're using a cache-control of less than one minute, we recommend using a Vercel Function instead of a Blob. As Vercel Blob is primarily designed for caching content for a longer time.
- If you're displaying the
pathnamefield of Blob responses in a UI, and using random suffixes, make sure you adpat the UI to show the longerpathname.
@vercel/[email protected]
Patch Changes
- f88d80b: Fix documentation links in README and types, no functional changes
@vercel/[email protected]
Patch Changes
- 54ce5f8: Allow all special characters to be used as pathname.
You can now use all the characters you want in pathname even the ones that have
special meaning in urls like%!'()@{}[]#and it will work as expected.