Using blob SDK put(). But looking for a get()

This is about how to get a blob from blob storage. I am using the put() function in the SDK successfully. But I don’t see a corresponding get() function in the docs or in the source code. At the moment I’m calling the put() function from client code, running in a locally running http server (for development). I’m provisioning the access token using the BLOB_READ_WRITE_TOKEN environment variable. The blobs are showing up fine in the Vercel console. I see I could probably use a sequence of REST API calls - perhaps first a head() to get the download URL and then a plain HTTP get to fetch the blob. But that feels like a lack of symmetry, and I’m wondering if I’ve missed something? Ps. The blob write/read is for internal purposes in the web page (stashing debug info to investigate error events). I.e. site visitors cannot trigger it themselves.

Expected behaviour was for there to be a get() function.

The project is a static website with a SPA architecture, and it has no backend apart from using some Google cloud APIs, and of course now, the Vercel blob service.
It uses the Svelte/Vite framework. (not sveltekit).

Hi @peterhoward42, welcome to the Vercel Community!

Your assumption is correct: you can use the head or the list function to get the Blob details. I’m not sure if I correctly understand the limitation you are facing. Can you describe in a bit more detail about the use case?

Thanks for the help. I’m sorted now thank you.

1 Like

2 posts were split to a new topic: CORS issue Vercel Blob client side

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.