Learn how to connect Bolt.new AI with Backblaze B2 in 2026 using simple steps to streamline file storage, automation, and project workflows.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
The integration works by writing normal Backblaze B2 API or SDK calls inside your bolt.new project, and providing the required B2 credentials as environment variables. Bolt.new does not have any built‑in “B2 connector.” You integrate the same way you would in any Node.js full‑stack app: authenticate with B2, request an upload URL, upload files, download files, and manage buckets using Backblaze’s documented REST API. Inside bolt.new this works exactly the same — you just run the API calls in backend code and store B2 keys in environment variables.
Backblaze B2 is a cloud object storage service. You talk to it using its official REST API or its official Node.js SDK. Bolt.new runs normal Node.js backend code, so integration is straightforward: install the SDK, add environment variables, write API calls.
The steps below are the correct real‑world recipe — nothing magic, nothing bolt‑specific.
Inside Backblaze’s dashboard:
Treat them like passwords.
In your bolt.new workspace open the Environment panel and add:
These are now available in your backend code via process.env.
npm install backblaze-b2
This is real, working Backblaze B2 Node.js code you can paste into your bolt.new backend (for example in an API route like api/upload.js):
// api/upload.js
import B2 from "backblaze-b2";
export async function POST(request) {
try {
const b2 = new B2({
applicationKeyId: process.env.B2_KEY_ID,
applicationKey: process.env.B2_APP_KEY
});
await b2.authorize(); // required before any B2 calls
const body = await request.formData();
const file = body.get("file");
const bucketId = process.env.B2_BUCKET_ID;
// Step: get an upload URL
const upload = await b2.getUploadUrl({ bucketId });
// Step: upload file bytes
const arrayBuffer = await file.arrayBuffer();
const buffer = Buffer.from(arrayBuffer);
const result = await b2.uploadFile({
uploadUrl: upload.data.uploadUrl,
uploadAuthToken: upload.data.authorizationToken,
fileName: file.name,
data: buffer
});
return new Response(
JSON.stringify({ success: true, fileId: result.data.fileId }),
{ status: 200 }
);
} catch (err) {
console.error(err);
return new Response(JSON.stringify({ error: "Upload failed" }), { status: 500 });
}
}
// Example in a React component inside bolt.new
async function uploadToB2(file) {
const form = new FormData();
form.append("file", file);
const res = await fetch("/api/upload", {
method: "POST",
body: form
});
return res.json(); // contains fileId / metadata
}
For public buckets, you can simply serve the file URL:
For private buckets, generate an authorized download URL:
// Example backend route
const result = await b2.getDownloadAuthorization({
bucketId: process.env.B2_BUCKET_ID,
fileNamePrefix: "",
validDurationInSeconds: 300 // 5 minutes signed URL
});
bolt.new doesn’t have its own “integration layer.” You are running normal Node.js. So:
This means the integration you build inside bolt.new is identical to what you'd deploy later to Vercel, AWS, or any other production environment.
This is the clean, real, correct way to integrate Bolt.new AI projects with Backblaze B2.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.