Skip to content

Releases: vercel/storage

@vercel/[email protected]

24 Oct 15:59
c90427a

Choose a tag to compare

Patch Changes

  • 1dee5ab: Support Next.js v16 Cache Components even within proxy.ts (fka middleware.ts) - see #890

    The @vercel/edge-config v1.4.1 release added support for Next.js v16 cacheComponents, but did not support using @vercel/edge-config in Next.js's proxy.ts (fka middleware.ts) when the cacheComponents flag was enabled in next.config.ts. This releases fixes this issue so @vercel/edge-config can be used in any server side context in Next.js again.

@vercel/[email protected]

22 Oct 17:02
b5cc954

Choose a tag to compare

Patch Changes

@vercel/[email protected]

16 Sep 08:17
a8df1cf

Choose a tag to compare

Major Changes

  • 0b8ead9: BREAKING CHANGE:

    To continue receiving onUploadCompleted callback once a file is uploaded with Client Uploads when not hosted on Vercel, you need to provide the callbackUrl at the onBeforeGenerateToken step when using handleUpload.

    When hosted on Vercel:
    No code changes required. The callbackUrl is inferred from Vercel system environment variables:

    • In preview environment: VERCEL_BRANCH_URL when available, otherwise VERCEL_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 the VERCEL_BLOB_CALLBACK_URL environment 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 callbackUrl at the client side level (browser) based on location.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.

@vercel/[email protected]

23 May 11:56
acaa9a0

Choose a tag to compare

Patch Changes

  • f65d3c9: copy, head and del can receive a blob url or pathname, until now it was not very clear.

@vercel/[email protected]

22 May 11:03
f232754

Choose a tag to compare

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 upload method in the client, which will be forwarded to the server endpoint specified by handleUploadUrl. This is particularly useful for sending authorization headers and solves issues like #796 and #420.

@vercel/[email protected]

19 May 14:19
1ade8df

Choose a tag to compare

Patch Changes

  • d3627fa: Update Vercel Blob API endpoint to a more efficient one

@vercel/[email protected]

02 May 13:54
1634fd2

Choose a tag to compare

Patch Changes

  • af5f54b: Add correct documentation to all exported methods

@vercel/[email protected]

10 Apr 15:00
0a62213

Choose a tag to compare

Major Changes

  • 00dfe23: Vercel Blob is now GA! To celebrate this we're releasing the 1.0.0 version of the Vercel Blob SDK which includes multiple changes and improvements.

    Changes:

    • addRandomSuffix is 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 pathname of blob responses and content-disposition header.
    • 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: true to put and onBeforeGenerateToken options.
    • If you're overwriting blobs, then add allowOverwrite: true to put and onBeforeGenerateToken options.
    • 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 pathname field of Blob responses in a UI, and using random suffixes, make sure you adpat the UI to show the longer pathname.

@vercel/[email protected]

13 Mar 14:27
a65d1b8

Choose a tag to compare

Patch Changes

  • f88d80b: Fix documentation links in README and types, no functional changes

@vercel/[email protected]

27 Feb 14:57
29ec7cd

Choose a tag to compare

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.