/bolt-ai-integration

Bolt.new AI and Backblaze B2 Cloud Storage integration: Step-by-Step Guide 2025

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.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

How to integrate Bolt.new AI with Backblaze B2 Cloud Storage?

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.

 

What “integration” actually means here

 

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.

 

What you need from Backblaze B2

 

  • Application Key ID (aka accountId)
  • Application Key
  • Bucket name (or bucketId)

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.

 

Environment variables inside Bolt.new

 

Inside the left sidebar, open the environment variables panel and add:

  • B2_KEY_ID
  • B2_APPLICATION_KEY
  • B2_BUCKET_ID

Bolt will inject these values into process.env for your Node.js backend.

 

Using the official Backblaze B2 SDK

 

The safest / simplest path is to install Backblaze’s maintained JavaScript SDK:

 

npm install backblaze-b2

 

Minimal working backend example (Node.js inside Bolt)

 

This example shows how to:

  • Authorize with B2
  • Get upload URL + token
  • Upload a file

 

// 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.
}

 

Express route example to expose B2 upload from Bolt

 

// 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;

 

How the flow works

 

  • User uploads file → goes to your Express backend in Bolt
  • The backend temporarily stores file in /tmp via multer
  • Your backend calls Backblaze:
    • authorize
    • get upload URL
    • upload file
  • B2 stores the file permanently
  • You return file metadata (fileId, etc.) to frontend

 

Security notes

 

  • Never expose your B2 keys to the frontend.
  • Your Bolt backend should be the only piece calling Backblaze APIs.
  • Use environment variables for credentials; do not commit them to code.

 

Hardening when moving outside Bolt

 

  • Move environment variables to your host (Render, Railway, AWS, etc.).
  • Use proper temp directories and permissions for uploaded files.
  • Add request authentication (JWT, session, cookie-based login).
  • Consider using B2’s “pre-signed URLs” if you want the browser to upload directly without routing through your backend.

 

Summary

 

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.

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022