Learn fast how to integrate Bolt.new AI with Backblaze B2 Cloud Storage in 2025 with this simple step-by-step guide for seamless automation.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
To integrate Bolt.new with Backblaze B2, you simply build a normal backend that talks to Backblaze’s REST API or the official SDK. Bolt.new itself doesn’t “plug into” B2 — instead, you scaffold routes and utility functions inside the Bolt workspace, add your B2 credentials as environment variables, and call B2’s APIs (authorize → get upload URL → upload file → list files, etc.). It behaves exactly like integrating B2 into any Node.js server, just running inside Bolt’s sandbox. You can prototype the integration inside Bolt, then migrate the same code to a real server unchanged.
In Bolt.new, you run real backend code (usually Node.js + Express). That backend can call any external service that exposes a REST API or SDK. Backblaze B2 exposes a very standard REST API, plus an official JavaScript SDK (b2 package). The integration works by storing your B2 credentials in environment variables inside Bolt, then making authenticated API calls from your backend files.
You are NOT integrating “Bolt AI” into B2. You are integrating a backend you build inside Bolt into B2.
These are created in Backblaze under “App Keys”. You never hard-code them in your code — you place them in Bolt.new as environment variables.
Inside the left sidebar, open the environment variables panel and add:
Bolt will inject these values into process.env for your Node.js backend.
The safest / simplest path is to install Backblaze’s maintained JavaScript SDK:
npm install backblaze-b2
This example shows how to:
// backend/b2.js
// A clean utility module to handle Backblaze B2 flows
import B2 from "backblaze-b2";
import fs from "fs";
const b2 = new B2({
applicationKeyId: process.env.B2_KEY_ID, // Required
applicationKey: process.env.B2_APPLICATION_KEY // Required
});
// Uploads a local file to B2
export async function uploadToB2(localFilePath, fileName) {
await b2.authorize(); // Must always happen first
// Read file from disk
const fileData = fs.readFileSync(localFilePath);
// Get upload URL for a specific bucket
const { data: uploadAuth } = await b2.getUploadUrl({
bucketId: process.env.B2_BUCKET_ID
});
// Upload file
const uploaded = await b2.uploadFile({
uploadUrl: uploadAuth.uploadUrl,
uploadAuthToken: uploadAuth.authorizationToken,
fileName: fileName,
data: fileData
});
return uploaded.data; // Contains fileId, fileName, etc.
}
// backend/routes/upload.js
import express from "express";
import multer from "multer"; // Handles form-data file uploads
import { uploadToB2 } from "../b2.js";
const router = express.Router();
const upload = multer({ dest: "/tmp" }); // Temp file storage in Bolt sandbox
router.post("/upload", upload.single("file"), async (req, res) => {
try {
const result = await uploadToB2(req.file.path, req.file.originalname);
res.json({ ok: true, file: result });
} catch (err) {
console.error(err);
res.status(500).json({ ok: false, error: err.message });
}
});
export default router;
Integration is straightforward: you build a regular Node.js backend in Bolt, add Backblaze credentials in Bolt’s environment variables, install the Backblaze SDK, and call their API endpoints. All real uploading is done by your backend code, not by Bolt itself. This setup works identically inside Bolt and in production environments.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.