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

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 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.
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.
MS_CLIENT_ID, MS_CLIENT_SECRET, MS_TENANT_ID).
https://{your-bolt-url}/api/auth/microsoft/callback.
In your Bolt.new project settings, set:
MS_CLIENT_ID=xxxxxMS_CLIENT_SECRET=xxxxxMS_TENANT_ID=xxxxxx
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;
/api or equivalent)./api/auth/microsoft.
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.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.