/bolt-ai-integration

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

Learn how to connect Bolt.new AI with OneDrive in 2026 using this clear step-by-step guide to streamline workflows and boost productivity.

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 OneDrive?

To integrate Bolt.new with OneDrive, you don’t connect “Bolt to OneDrive” directly. Instead, inside a Bolt.new project you build a normal integration with the Microsoft Graph API (which is the real API behind OneDrive). Bolt.new gives you a sandbox where you write frontend/backend code, store environment variables, and run OAuth flows — the integration itself is just standard OAuth 2.0 + REST calls to Microsoft Graph. Once authenticated, you can list files, upload, download, create folders, etc.

 

What the integration really is

 

You add code inside your Bolt.new backend that handles the Microsoft OAuth 2.0 flow, receives an access token, stores it securely (in environment variables or session storage depending on your app), and then you call Microsoft Graph endpoints such as /v1.0/me/drive/root/children for file listing or /v1.0/me/drive/items/{itemId}/content for file upload/download.

Bolt.new doesn’t give you any special OneDrive feature — but it gives you a place to write realistic code quickly and test it inside a browser-based sandbox.

 

The steps you follow (in Bolt terms)

 

  • You create an Azure App Registration so Microsoft lets your app access OneDrive.
  • You copy the Client ID, Client Secret, and set a redirect URL that matches your Bolt.new backend route.
  • You store the secrets in bolt environment variables (e.g. MS_CLIENT_ID, MS_CLIENT_SECRET, MS_TENANT_ID).
  • You implement a backend route in Bolt.new that starts the OAuth flow by redirecting the user to Microsoft’s login page.
  • You implement a second backend route that receives Microsoft’s callback, exchanges the authorization code for an access token, then uses that token to call Microsoft Graph.

 

Azure setup (the unavoidable part)

 

  • Go to Azure Portal → App Registrations → New Registration.
  • Add Redirect URI: something like https://{your-bolt-url}/api/auth/microsoft/callback.
  • Under API permissions add: Files.ReadWrite (or whatever scope you need).
  • Create a Client Secret and save it — you’ll need it in Bolt.

 

Environment variables in Bolt.new

 

In your Bolt.new project settings, set:

  • MS_CLIENT_ID=xxxxx
  • MS_CLIENT_SECRET=xxxxx
  • MS_TENANT_ID=xxxxxx

 

Example backend code inside Bolt.new (Node/Express-style)

 

Below is a minimal working example you can paste into a Bolt.new backend route file. It shows the exact OAuth flow and one Graph call:

 

// Required dependencies
import express from "express";
import fetch from "node-fetch";
import querystring from "querystring";

const router = express.Router();

const clientId = process.env.MS_CLIENT_ID;
const clientSecret = process.env.MS_CLIENT_SECRET;
const tenantId = process.env.MS_TENANT_ID;
const redirectUri = "https://YOUR-BOLT-URL/api/auth/microsoft/callback"; // Replace with actual Bolt URL

// Step 1: Start OAuth login
router.get("/auth/microsoft", async (req, res) => {
  const params = querystring.stringify({
    client_id: clientId,
    response_type: "code",
    redirect_uri: redirectUri,
    response_mode: "query",
    scope: "offline_access Files.ReadWrite"
  });

  res.redirect(`https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/authorize?${params}`);
});

// Step 2: Receive callback and exchange code for token
router.get("/auth/microsoft/callback", async (req, res) => {
  const code = req.query.code;

  const tokenRes = await fetch(
    `https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/token`,
    {
      method: "POST",
      headers: { "Content-Type": "application/x-www-form-urlencoded" },
      body: querystring.stringify({
        client_id: clientId,
        client_secret: clientSecret,
        grant_type: "authorization_code",
        code: code,
        redirect_uri: redirectUri
      })
    }
  );

  const tokenJson = await tokenRes.json();
  const accessToken = tokenJson.access_token;

  // Example Microsoft Graph call: list files in OneDrive root
  const filesRes = await fetch("https://graph.microsoft.com/v1.0/me/drive/root/children", {
    headers: { Authorization: `Bearer ${accessToken}` }
  });

  const files = await filesRes.json();

  // Send results to browser or your frontend
  res.json({ token: tokenJson, files });
});

export default router;

 

How you use this inside Bolt.new

 

  • Expose the backend routes through Bolt’s internal server (Bolt auto-wires them if placed in /api or equivalent).
  • Add a frontend button “Connect OneDrive” that hits /api/auth/microsoft.
  • After OAuth returns, your callback fetches and displays real OneDrive data.

 

What to be careful about

 

  • OAuth redirect URIs must match exactly — including https, slashes, trailing slash.
  • Microsoft Graph rate limits apply; keep calls minimal.
  • Store tokens securely. In Bolt.new, use environment variables for secrets, session/db for per-user tokens.
  • In production, re-run Azure setup with your real domain.

 

End result

 

You get a Bolt.new full‑stack app that can authenticate a user with Microsoft, obtain a valid Graph access token, and call the OneDrive API to list, upload, or download files. Nothing proprietary — just standard OAuth + REST inside a Bolt sandbox.

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