/bolt-ai-integration

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

Learn how to integrate Bolt.new AI with Facebook Ads in 2026 using this simple step-by-step guide to optimize campaigns and boost results.

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

To integrate Bolt.new AI with Facebook Ads, you don’t “connect Bolt to Facebook” directly. Instead, you build a normal app inside the Bolt workspace (usually a small Node.js or Python backend) that talks to the Facebook Marketing API using real HTTPS requests. You authenticate using a Facebook App + a system user access token stored in Bolt environment variables. Bolt then becomes your scaffolding and execution space where the code runs and communicates with Facebook Ads exactly like any other external API.

 

What the integration actually is

 

You integrate Facebook Ads by building a small backend in Bolt that does one or more of these via the official Facebook Marketing API:

  • Create ads
  • Fetch campaign/ads/insights
  • Update budgets, targeting, statuses

Bolt is simply where you write and run the code. The connection is HTTPS to Meta's REST API, authenticated with a long‑lived access token stored in Bolt environment variables.

 

What you need from Facebook first

 

  • Create a Facebook App at https://developers.facebook.com
  • Create a Business Manager system user
  • Assign the system user ads_management and business_management permissions
  • Generate a long-lived system user access token
  • Get your ad_account_id (format: act\_1234567890)

You then store the token inside Bolt.new under environment variables (which are just hidden key–value pairs available to your backend code).

 

Store credentials in Bolt.new

 

  • Open Bolt.new
  • Go to Environment tab
  • Add FB_ACCESS_TOKEN
  • Add FB_AD_ACCOUNT\_ID

Never hardcode tokens — Bolt environment variables are the correct place.

 

Basic example: Fetch Facebook Ads campaigns from Bolt

 

Here is a minimal Node.js endpoint you can drop into a Bolt.new project to verify the integration works:

// server.js

import express from "express";
import fetch from "node-fetch";

const app = express();

app.get("/facebook/campaigns", async (req, res) => {
  try {
    const token = process.env.FB_ACCESS_TOKEN;       // stored in Bolt env vars
    const adAccountId = process.env.FB_AD_ACCOUNT_ID;

    const url = `https://graph.facebook.com/v19.0/${adAccountId}/campaigns?fields=name,status&access_token=${token}`;

    const fbRes = await fetch(url);
    const data = await fbRes.json();

    res.json(data);
  } catch (err) {
    res.status(500).json({ error: err.message });
  }
});

app.listen(3000, () => {
  console.log("Server running on port 3000");
});

When you run this inside Bolt, it will reach out to Meta's Marketing API using your stored token and return your actual campaign data.

 

Example: Creating a Facebook Ad campaign from Bolt

 

This shows a POST request to create a campaign (again, standard REST, nothing Bolt‑specific):

// create-campaign.js

import fetch from "node-fetch";

export async function createCampaign(name) {
  const token = process.env.FB_ACCESS_TOKEN;
  const adAccountId = process.env.FB_AD_ACCOUNT_ID;

  const url = `https://graph.facebook.com/v19.0/${adAccountId}/campaigns`;

  const body = new URLSearchParams({
    name,
    objective: "OUTCOME_TRAFFIC",   // real objective
    status: "PAUSED",
    access_token: token
  });

  const res = await fetch(url, {
    method: "POST",
    body
  });

  return res.json();
}

This is exactly how real Facebook API calls work.

 

Key constraints you must respect

 

  • You need a Business Manager system user for stable long-lived tokens.
  • If you try to use a normal user token, it will expire quickly.
  • Your app must be in Live Mode to access real ads accounts.
  • Facebook API rate limits apply (Bolt does not bypass them).
  • Bolt cannot store refresh tokens unless you put them in env vars yourself.

 

How to test properly in Bolt.new

 

  • Use Bolt’s preview server to call your API endpoints from the browser.
  • Log raw Facebook responses to ensure permissions are correct.
  • Move secrets into environment variables before shipping anything.
  • Use Meta’s Graph API Explorer to test permissions and fields first.

 

How to deploy outside Bolt

 

Once your integration works in Bolt, you can deploy the same backend code to any environment (Vercel, Render, AWS, etc.). Just replicate the same environment variables and it will behave the same, because you’re using standard REST calls.

This is the correct way to integrate Bolt.new AI with Facebook Ads: build a backend inside Bolt that uses the official Marketing API with proper authentication, environment variables, and real HTTPS requests. That's it — straightforward, reliable, production-ready.

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