/bolt-ai-integration

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

Step-by-step 2025 guide to integrating Bolt.new AI with Bing Ads to streamline setup, automate campaigns, and improve ad performance.

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 Bing Ads?

To integrate Bolt.new with Bing Ads, you do NOT connect “Bolt” itself to Bing Ads. Instead, you build a normal backend (Node.js or Python) inside Bolt’s workspace and connect THAT backend to Microsoft Advertising (formerly Bing Ads) using the official Microsoft Advertising API. Authentication is done through Microsoft Entra ID OAuth2, and from there you call the REST endpoints using standard HTTP requests. Inside bolt.new, you store the required secrets (client_id, client_secret, refresh_token) in environment variables, then you write API routes that talk to Bing Ads.

In short: you integrate with Bing Ads in Bolt.new the same way you would integrate with Bing Ads anywhere else — by implementing Microsoft’s OAuth flow, saving tokens, and calling their Advertising API from your server code.

 

What You Actually Do (High‑Level)

 

You create a small backend inside Bolt.new that:

  • Uses Microsoft Entra ID OAuth2 to obtain an access token.
  • Stores client credentials and refresh token in Bolt environment variables.
  • Calls the Microsoft Advertising API endpoints using HTTPS.
  • Optionally exposes routes your front‑end (React, Next.js, plain JS) can hit.

This is the real, correct, production‑valid way. There is no special Bolt or magical AI connector — you use standard API integration patterns.

 

Step‑By‑Step Integration

 

This is the exact process you would follow inside Bolt.new or any real app.

  • Create a Microsoft Azure App Registration You go to Azure Portal → Microsoft Entra ID → App registrations. This gives you:
    – client\_id
    – client\_secret
    – redirect\_uri
  • Enable Microsoft Advertising API permissions In the same app, under API permissions, add “Microsoft Advertising API” with delegated permissions.
  • Generate OAuth2 refresh token You manually complete the OAuth consent URL once. That URL looks like this (real pattern): https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=YOUR_CLIENT_ID&response_type=code&redirect_uri=YOUR_REDIRECT&scope=https%3A%2F%2Fads.microsoft.com%2Fads.manage%20offline\_access
  • Save secrets in Bolt.new environment variables In Bolt, go to the left sidebar → Environment Variables area. Save:
    MICROSOFT_CLIENT_ID
    MICROSOFT_CLIENT_SECRET
    MICROSOFT_REFRESH_TOKEN
  • Write code that exchanges the refresh token for an access token
  • Use that access token to hit Bing Ads endpoints

 

Real Working Example (Node.js in Bolt)

 

// This example shows how to fetch an access token using your refresh token
// and then call the Microsoft Advertising "GetAccounts" endpoint.

// Imports
import fetch from "node-fetch";

// Load secrets from Bolt environment variables
const clientId = process.env.MICROSOFT_CLIENT_ID;
const clientSecret = process.env.MICROSOFT_CLIENT_SECRET;
const refreshToken = process.env.MICROSOFT_REFRESH_TOKEN;

// Function to get access token
async function getAccessToken() {
  const tokenUrl = "https://login.microsoftonline.com/common/oauth2/v2.0/token";

  const params = new URLSearchParams();
  params.append("client_id", clientId);
  params.append("client_secret", clientSecret);
  params.append("refresh_token", refreshToken);
  params.append("grant_type", "refresh_token");
  params.append("scope", "https://ads.microsoft.com/ads.manage");

  const resp = await fetch(tokenUrl, {
    method: "POST",
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    body: params
  });

  const data = await resp.json();
  return data.access_token; // usable for Bing Ads API calls
}

// Example API call
async function getAccounts() {
  const token = await getAccessToken();

  const resp = await fetch("https://ads.microsoft.com/Api/Advertiser/Accounts", {
    method: "GET",
    headers: {
      Authorization: `Bearer ${token}`,
      Accept: "application/json"
    }
  });

  const data = await resp.json();
  return data;
}

// Export a route your Bolt server can use
export async function GET() {
  const result = await getAccounts();
  return new Response(JSON.stringify(result), { status: 200 });
}

 

How You Use This Inside Bolt.new

 

  • You open Bolt.new and scaffold a small project (Node/Express or Next.js API routes).
  • You paste the code into your API route file.
  • You configure environment variables.
  • You run the workspace → the endpoint calls the real Bing Ads API.

Bolt doesn’t do anything special here; it simply provides a browser workspace where your normal backend code runs. Everything else is done through standard Microsoft APIs.

 

What This Lets You Build

 

  • Dashboards showing campaign performance.
  • Automations that pause/activate campaigns.
  • Daily data pipelines pulling Bing Ads spend into your database.
  • AI‑powered optimizers inside Bolt (you call your own API route, Bolt’s AI helps generate code).

You can prototype all of this in Bolt and later deploy the exact same code to a normal server (Vercel, AWS, Render, etc.).

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