PackagesStorage Providers
@prood/storage-vercel-blob
Vercel Blob storage provider — default file upload backend for product images and assets.
@prood/storage-vercel-blob implements the StorageProvider interface using Vercel Blob for file uploads with CDN delivery.
Installation
pnpm add @prood/storage-vercel-blobSelected automatically when STORAGE_PROVIDER=vercel-blob (default).
StorageProvider interface
| Method | Purpose |
|---|---|
upload() | Store a file and return public URL + key |
delete() | Remove an object by key |
getSignedUrl() | Optional time-limited URL (Blob uses public URLs) |
Configuration
| Variable | Required | Description |
|---|---|---|
BLOB_READ_WRITE_TOKEN | Yes | Vercel Blob read/write token |
Provision via the Vercel marketplace integration or Vercel dashboard.
Usage
Typically used via @prood/commerce helpers (not directly):
import { uploadForTenant } from '@prood/commerce'
const result = await uploadForTenant(orgId, {
file: buffer,
filename: 'product-image.jpg',
contentType: 'image/jpeg',
directory: `products/${productId}`,
})
// result.url → https://xxx.public.blob.vercel-storage.com/org/org_demo/products/...
// result.key → org/org_demo/products/prod_abc/product-image-xxx.jpgTenant namespacing
All uploads are prefixed with org/{orgId}/ to prevent cross-tenant collisions:
org/org_demo/products/prod_abc/image-abc123.jpg
org/org_xyz/products/prod_def/image-def456.jpgVercel Blob uploads use addRandomSuffix for unguessable URLs.
Direct usage
import { VercelBlobStorageProvider } from '@prood/storage-vercel-blob'
const storage = new VercelBlobStorageProvider({
token: process.env.BLOB_READ_WRITE_TOKEN!,
})
const result = await storage.upload({
file: buffer,
filename: 'image.jpg',
contentType: 'image/jpeg',
key: 'org/org_demo/products/image.jpg',
})