/bolt-ai-integration

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

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

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?

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.

 

What You Actually Do (the real, working integration path)

 

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.

  • Create a Backblaze B2 application key + key ID.
  • Put them into bolt.new Environment Variables (never hardcode secrets).
  • Install Backblaze’s official Node.js SDK inside bolt.new.
  • Write backend code that authenticates and uploads/downloads files.
  • Expose routes or functions your front‑end can call.

 

Create B2 Credentials

 

Inside Backblaze’s dashboard:

  • Go to App Keys.
  • Create a key with the scope and bucket you want.
  • Copy keyID and applicationKey.

Treat them like passwords.

 

Add Environment Variables in bolt.new

 

In your bolt.new workspace open the Environment panel and add:

  • B2_KEY_ID = yourKeyID
  • B2_APP_KEY = yourApplicationKey
  • B2_BUCKET_ID = the bucket you want to use

These are now available in your backend code via process.env.

 

Install the Backblaze Node.js SDK

 

npm install backblaze-b2

 

Write Backend Code to Authenticate and Upload

 

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 });
  }
}

 

Front-End Example (bolt.new front-end talking to your API)

 

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

 

Downloading Files from B2

 

For public buckets, you can simply serve the file URL:

  • https://f000.backblazeb2.com/file/yourBucketName/yourFileName

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
});

 

How This Works Inside bolt.new

 

bolt.new doesn’t have its own “integration layer.” You are running normal Node.js. So:

  • You install dependencies.
  • You write backend routes.
  • You store secrets in environment variables.
  • You call external APIs exactly like any other application.

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.

 

Most Important Constraints to Remember

 

  • B2 operations require authorization before every session.
  • Uploads must use getUploadUrl first — you cannot upload directly to the API endpoint without this step.
  • Never expose your B2 keys to the front‑end.
  • Larger files may require streaming; the example above works for typical uploads.

 

This is the clean, real, correct way to integrate Bolt.new AI projects with Backblaze B2.

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