/bolt-ai-integration

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

Step-by-step 2026 guide to integrating Bolt.new AI with Google Fit. Learn setup, syncing, and automation for seamless health data 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 Google Fit?

To integrate Bolt.new with Google Fit, you don’t “connect Bolt to Google Fit directly.” What you actually do is build a normal web backend inside Bolt.new that talks to the Google Fitness REST API using OAuth2 to obtain user permission. Bolt.new is just your development workspace; the integration itself is done through standard Google APIs, authenticated with a Google OAuth client ID, and called from your server code (Node.js, Python, etc.) that runs inside the Bolt sandbox. Once you understand that, the whole process becomes straightforward: create Google OAuth credentials, configure redirect URIs, implement OAuth login inside a Bolt project, store tokens safely, and then call Google Fit endpoints using those tokens.

 

What You Actually Do (Short Version)

 

You create a Google Cloud project, enable Google Fit API, set up OAuth credentials, add the Bolt sandbox host URL as an authorized redirect URL, then in Bolt.new you implement an OAuth login flow and use the returned access token to make Fetch or SDK calls to Google Fit endpoints. Bolt.new isn’t special — it’s just where your Node/Python code runs.

 

Step‑by‑Step Explanation

 

Each step is real, verified, and matches how Google Fit and OAuth actually work.

  • Create a Google Cloud Project at console.cloud.google.com.
  • Enable the Google Fitness API (it’s a REST API for accessing health-related datasets).
  • Create OAuth 2.0 credentials (client ID + client secret).
  • Add your Bolt.new project’s authorized redirect URL.
    Inside Bolt, every project you run has a temporary public URL such as:
    https://xxxxx-5000.bolt.live/auth/callback
    Copy that into Google Cloud's Authorized redirect URIs.
  • Store client ID + secret as environment variables in Bolt.new using the Environment panel.
  • Implement the OAuth login route + callback route.
  • Exchange the authorization code for an access\_token.
  • Use that access token to call Google Fit REST endpoints.

 

Scopes You Will Need

 

Google Fit doesn’t allow blanket access. You must request the correct scopes. Examples:

  • https://www.googleapis.com/auth/fitness.activity.read
  • https://www.googleapis.com/auth/fitness.heart\_rate.read
  • https://www.googleapis.com/auth/fitness.sleep.read

Ask only for scopes your app actually needs.

 

Minimal Working Node.js Example (Fits Inside Bolt.new)

 

// server.js
// Bolt.new app using Express to authenticate with Google Fit API

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

dotenv.config();

const app = express();

const clientId = process.env.GOOGLE_CLIENT_ID;
const clientSecret = process.env.GOOGLE_CLIENT_SECRET;
const redirectUri = process.env.GOOGLE_REDIRECT_URI; 
// Example: "https://xxxxx-5000.bolt.live/auth/callback"

app.get("/auth/google", (req, res) => {
  const scope = [
    "https://www.googleapis.com/auth/fitness.activity.read",
    "https://www.googleapis.com/auth/fitness.heart_rate.read"
  ].join(" ");

  const authUrl =
    "https://accounts.google.com/o/oauth2/v2/auth" +
    `?client_id=${clientId}` +
    `&redirect_uri=${encodeURIComponent(redirectUri)}` +
    "&response_type=code" +
    `&scope=${encodeURIComponent(scope)}` +
    "&access_type=offline";

  res.redirect(authUrl);
});

app.get("/auth/callback", async (req, res) => {
  const code = req.query.code;

  // Exchange code for tokens
  const tokenResp = await fetch("https://oauth2.googleapis.com/token", {
    method: "POST",
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    body: new URLSearchParams({
      code,
      client_id: clientId,
      client_secret: clientSecret,
      redirect_uri: redirectUri,
      grant_type: "authorization_code"
    })
  });

  const tokens = await tokenResp.json();

  // Example API call to Google Fit (Activities dataset)
  const fitResp = await fetch(
    "https://www.googleapis.com/fitness/v1/users/me/dataSources",
    {
      headers: { Authorization: `Bearer ${tokens.access_token}` }
    }
  );

  const fitData = await fitResp.json();

  res.json({ tokens, fitData });
});

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

 

How This Maps to Bolt.new

 

  • You open Bolt.new, create a Node.js project, paste the code above.
  • Set environment variables (GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GOOGLE_REDIRECT_URI).
  • Run the server; Bolt gives you a public URL.
  • Copy the callback URL into Google Cloud Console.
  • Click /auth/google from your Bolt app’s URL to start the OAuth flow.

 

What Happens After Authentication

 

Your Bolt backend now has a valid Google OAuth access_token (and refresh_token if requested). Every call to Google Fit is a normal HTTPS request. Bolt does not store tokens for you — you must handle them in code or a database. When you deploy outside Bolt, the same code works, you just change environment variables and stable domain names.

 

The Key Idea

 

You aren’t “connecting Bolt to Google Fit.” You’re building a standard web service that uses Google OAuth + Google Fit API, and you just happen to be building and testing that service in Bolt.new’s sandbox. Everything is standard, secure, and portable.

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