DSAR
Storage

Vercel Blob Storage

@dsar/storage-vercel-blob stores DSAR fulfilment artifacts in Vercel's managed blob storage service. Zero infrastructure setup when deploying on Vercel.

Installation

Package managerCommand
npmnpm install @dsar/storage-vercel-blob
pnpmpnpm add @dsar/storage-vercel-blob
yarnyarn add @dsar/storage-vercel-blob
bunbun add @dsar/storage-vercel-blob

Setup

import { dsarInstance } from "@dsar/backend";
import { makeVercelBlobStorageAdapter } from "@dsar/storage-vercel-blob";

const runtime = dsarInstance({
	adapters: {
		inbound: "stub",
		notifications: "stub",
		storage: makeVercelBlobStorageAdapter({
			prefix: "artifacts",
			readWriteToken: process.env.BLOB_READ_WRITE_TOKEN,
			retryMaxAttempts: 3,
			timeoutMs: 3000,
		}),
	},
});

Configuration

OptionDefaultDescription
readWriteTokenprocess.env.BLOB_READ_WRITE_TOKENVercel Blob read-write token
prefixartifactsKey prefix for all stored objects
addRandomSuffixfalseAppend random suffix to keys
allowOverwritefalseAllow overwriting existing objects
cacheControlMaxAgeCDN cache-control max age
timeoutMs10000Request timeout in milliseconds
retryMaxAttempts3Retry count for retriable failures

Key Layout

Default deterministic key format:

<prefix>/<requestId>/<manifestId>/<category>/<redaction>/<thirdParty>/<artifactName>

Fallback values:

  • missing requestIdrequest-unknown
  • missing manifestIdmanifest-unknown
  • missing categoryuncategorized
  • missing name/id → artifact.bin

Error and Retry Behaviour

CategoryRetriableExamples
timeoutyesrequest abort, blob service unavailable
rate_limityesblob rate limiting / throttling
networkyesfetch/socket connectivity failures
authnoinvalid token, store suspended/not found
validationnomalformed input/config
confignoadapter setup invalid
unknownnounmatched provider errors

Caching and Overwrite Notes

  • Vercel Blob put(...) requires access: "public" and serves content through CDN cache.
  • Prefer immutable pathnames and keep allowOverwrite disabled unless you explicitly need mutation.
  • If overwrite is enabled, cached clients may still observe stale content until cache expiry (cacheControlMaxAge).