@airnauts/airside-storage-vercel-blob
v0.9.1
Published
Vercel Blob attachment-storage adapter for the Airnauts commenting tool server.
Readme
@airnauts/airside-storage-vercel-blob
Vercel Blob attachment-storage adapter for the Airside server. Uploads images to Vercel Blob and returns public CDN URLs.
Installation
pnpm add @airnauts/airside-storage-vercel-blobQuick start
import { createVercelBlobStorage } from '@airnauts/airside-storage-vercel-blob'
const storage = createVercelBlobStorage({
token: process.env.BLOB_READ_WRITE_TOKEN!,
})Pass storage to createAirsideServer from @airnauts/airside-server (or to createAirsideAppRoute / createAirsidePagesRoute from @airnauts/airside-integration-next).
API reference
createVercelBlobStorage(opts)
createVercelBlobStorage({
token: string // Vercel Blob read-write token (required; never read from process.env automatically)
prefix?: string // Optional key prefix, e.g. "staging/" (trailing slash added automatically)
}): StorageAdapterEach upload calls @vercel/blob's put with access: "public" and addRandomSuffix: true.
VercelBlobStorage
The underlying class, exported for direct construction:
import { VercelBlobStorage } from '@airnauts/airside-storage-vercel-blob'
const storage = new VercelBlobStorage({ token: process.env.BLOB_READ_WRITE_TOKEN! })VercelBlobStorageOptions
type VercelBlobStorageOptions = {
token: string
prefix?: string
}Configuration / env vars
| Env var | Description |
|---|---|
| BLOB_READ_WRITE_TOKEN | Vercel Blob token — copy from the Vercel dashboard Storage tab |
The token is passed explicitly to createVercelBlobStorage({ token }) — the adapter never reads process.env automatically.
Requirements
- Node.js ≥ 18 (or any fetch-capable runtime)
- A Vercel project with a Blob store attached
Related packages
@airnauts/airside-server— defines theStorageAdapterinterface@airnauts/airside-storage-fs— filesystem alternative for local development
License
MIT © Airnauts
