/bolt-ai-integration

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

Step-by-step 2025 guide to integrate Bolt.new AI with Time Doctor and streamline workflows for faster, smarter 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 Time Doctor?

You integrate Bolt.new with Time Doctor the same way you integrate any external SaaS in Bolt: by calling Time Doctor’s public REST API from code you write inside Bolt’s server-side environment. Bolt.new does not have a built‑in “Time Doctor connector.” You authenticate using a Time Doctor OAuth2 token or a Personal Access Token (depending on the Time Doctor account type), store it as an environment variable in Bolt, and then call Time Doctor’s API endpoints (for example, to fetch user activity, screenshots, time entries, etc.). Everything is done through standard HTTP requests using fetch() or an HTTP client.

 

What You Actually Do

 

You create a small backend route in Bolt.new (Node.js inside the /api folder). That route talks to Time Doctor’s REST API using your token. Then your frontend or your AI agent calls that backend route. That’s the entire integration pattern.

  • No plugin system exists between Bolt and Time Doctor.
  • Everything happens via REST API calls you write.
  • Auth must be managed by you (typically OAuth2 or a Time Doctor PAT).
  • Tokens go in Bolt environment variables to avoid exposing secrets.

 

How Time Doctor Authentication Works

 

Time Doctor offers two real auth methods (these are real, documented):

  • OAuth2 – for apps you want to distribute or for accounts requiring user consent.
  • Personal Access Token (PAT) – simpler; ideal for internal automations, service scripts, and Bolt prototypes.

If you are prototyping in Bolt.new, use the PAT method because it avoids needing OAuth callback routes and simplifies everything. You create it inside your Time Doctor account under Settings → Integrations → Developer API (this exists in Time Doctor 2 and Time Doctor Classic).

 

Set Environment Variables in Bolt.new

 

In your Bolt project → "Environment variables":

  • TIME_DOCTOR_API\_TOKEN = your PAT token
  • TIME_DOCTOR_COMPANY\_ID = (optional, but often necessary)

Bolt will inject these into process.env in your server-side code.

 

Basic Working Example: Fetching Time Doctor Worklogs from Bolt.new

 

This is a real, valid pattern. Time Doctor API endpoint example (Time Doctor 2): GET https://api.timedoctor.com/v2/companies/{company\_id}/worklogs

Inside Bolt.new, create a file: /api/timedoctor-worklogs.js

// This route runs server-side in Bolt.new
export default async function handler(req, res) {
  try {
    const token = process.env.TIME_DOCTOR_API_TOKEN;  // stored securely
    const companyId = process.env.TIME_DOCTOR_COMPANY_ID;

    const tdRes = await fetch(
      `https://api.timedoctor.com/v2/companies/${companyId}/worklogs`,
      {
        method: "GET",
        headers: {
          "Authorization": `Bearer ${token}`,
          "Content-Type": "application/json"
        }
      }
    );

    if (!tdRes.ok) {
      return res.status(tdRes.status).json({
        error: "Time Doctor API error",
        details: await tdRes.text()
      });
    }

    const data = await tdRes.json();
    return res.status(200).json(data);  // return to frontend or AI agent
  } catch (err) {
    return res.status(500).json({ error: "Unexpected error", details: err.message });
  }
}

 

How the Frontend or AI Agent Uses It

 

In the Bolt UI or any frontend page:

const loadWorklogs = async () => {
  const res = await fetch("/api/timedoctor-worklogs");
  const data = await res.json();
  console.log(data); // Now you can render or inspect the logs
};

 

Common Real-World Notes & Limits

 

  • Rate limits: Time Doctor enforces rate limits. Add retries or backoff when hardening.
  • CORS: You must call Time Doctor from the server side, not directly from frontend, because PATs must stay private.
  • Pagination: Time Doctor endpoints often paginate results; check "page" and "per\_page" parameters.
  • Time zones: Worklogs and screenshots use UTC timestamps—convert in frontend if needed.
  • Screenshot API: Returns URLs requiring token-based access; don't expose them publicly.

 

If You Need OAuth2 Instead of PAT

 

Only use if your client requires user-consent or multi-user setup. In Bolt.new you create two backend routes:

  • /api/auth/time-doctor/start – redirects user to Time Doctor OAuth authorization URL
  • /api/auth/time-doctor/callback – Time Doctor returns a code, you exchange it for an access token

You store the resulting token in a DB or session. This is standard OAuth2; no proprietary tricks.

 

Final Integration Architecture

 

  • Frontend or AI agent → calls your Bolt API routes
  • Bolt API routes → call Time Doctor REST API with PAT / OAuth tokens
  • Time Doctor → returns JSON → you use it in UI or AI flows

This is the clean, real, production-valid way to integrate Bolt.new with Time Doctor.

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