TinyWebDB deployment for Vercel Functions (Node.js Runtime) with Blob storage.
- Node.js Runtime: Uses Vercel's Node.js runtime (required for @vercel/blob)
- Unlimited storage: No size limits for individual values (up to 500 MB per blob)
- CDN distribution: Automatic global content delivery
- Cost-effective: Pay only for what you use
- A Vercel account (sign up for free)
- Vercel CLI installed (optional for manual deployment):
npm install -g vercel
The easiest way to deploy is using the one-click button:
This will:
- Clone the repository to your GitHub account
- Create a new Vercel project
- Automatically create a Vercel Blob store
- Deploy your TinyWebDB service
cd packages/vercel-blob
npm installUsing Vercel CLI:
vercel link # Link to your Vercel project
vercel blob create tinywebdb-blob # Create Blob storeOr via Vercel Dashboard:
- Go to your project
- Navigate to "Storage" tab
- Create a new Blob store
- Name it
tinywebdb-blob
The Blob store credentials will be automatically linked to your project. Verify by checking:
vercel env lsYou should see:
BLOB_READ_WRITE_TOKEN
npm run deployOr using Vercel CLI:
vercel --prodYour TinyWebDB service will be deployed to:
https://your-project-name.vercel.app
# Pull environment variables from Vercel
vercel env pull .env.local
# Start development server
npm run devThis starts a local development server at http://localhost:3000.
npm run buildOnce deployed, your service will have these endpoints:
curl -X POST https://your-project.vercel.app/storeavalue \
-H "Content-Type: application/json" \
-d '{"tag":"mykey","value":"myvalue"}'curl -X POST https://your-project.vercel.app/getvalue \
-H "Content-Type: application/json" \
-d '{"tag":"mykey"}'curl -X POST https://your-project.vercel.app/deleteentry \
-H "Content-Type: application/json" \
-d '{"tag":"mykey"}'To use a custom domain:
- Go to your project settings in Vercel Dashboard
- Navigate to "Domains"
- Add your custom domain
- Follow the DNS configuration instructions
Vercel automatically creates preview deployments for each branch:
- Production:
mainbranch →your-project.vercel.app - Preview: Other branches →
your-project-git-branch.vercel.app
To use different Blob stores per environment:
- Create separate Blob stores (e.g.,
tinywebdb-prod,tinywebdb-dev) - Link them to specific branches in Vercel Dashboard
- Configure environment variables per environment
vercel blob listvercel blob delete <blob-url>vercel blob get <blob-url>Vercel Blob pricing (as of 2024):
Hobby (Free) plan:
- 100 MB storage
- 1 GB bandwidth/month
- Public access included
Pro plan ($20/month):
- 100 GB storage included
- 1 TB bandwidth/month included
- Additional: $0.15/GB storage, $0.15/GB bandwidth
See Vercel Blob pricing for details.
- Storage limit: Free tier limited to 100 MB
- Bandwidth: Free tier limited to 1 GB/month
- File size: Individual blobs can be up to 500 MB (with multipart upload)
Make sure you've:
- Created a Vercel Blob store
- Linked it to your project
- Pulled environment variables locally:
vercel env pull .env.local
You've hit the storage limit. Either:
- Delete unused blobs
- Upgrade to a paid plan
- Optimize your data storage
You've hit the monthly bandwidth limit. Either:
- Wait for the monthly reset
- Upgrade to a paid plan
- Reduce the number of requests
Blob data is distributed via CDN. The first read from a new region may be slower, but subsequent reads will be cached and faster.
If you need to enable CORS for browser requests, modify the response headers in api/index.ts:
return new Response(httpResponse.body, {
status: httpResponse.status,
headers: {
...httpResponse.headers,
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type',
},
});Vercel Blob is ideal for:
- Large values: Storing data > 25 MB (KV limit)
- File storage: Images, documents, media files
- Cost-sensitive: Applications with large storage needs
- CDN delivery: Content that benefits from global distribution
MIT