api-time-machine is a Chrome extension + local server that records every XHR and fetch request your app makes, then lets you replay any past network state on demand.
You're not debugging the current state of your app. You're debugging the exact state it was in 3 hours ago, during that specific user flow.
Most bugs are time-sensitive. Now you can go back.
┌──────────────────────────────────────────────────────────┐
│ 🔌 CHROME EXTENSION │
│ │
│ Intercepts all XHR + fetch traffic via DevTools Protocol│
│ ├── Request: method, URL, headers, body │
│ ├── Response: status, headers, body │
│ └── Timestamp + session metadata │
│ │
│ Streams to local server in real-time │
└───────────────────────────────┬──────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────┐
│ 🗄️ LOCAL SERVER │
│ │
│ Stores traffic snapshots as named sessions │
│ ├── "session_before_the_crash" │
│ ├── "session_checkout_flow_2024_01_15" │
│ └── "session_user_reported_bug" │
└───────────────────────────────┬──────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────┐
│ 🔁 REPLAY ENGINE │
│ │
│ Load any saved session → intercept your app's requests │
│ → return the RECORDED responses instead of live ones │
│ │
│ Your app runs exactly as it did at that moment in time │
└──────────────────────────────────────────────────────────┘
| Layer | Technology | Purpose |
|---|---|---|
| Extension | Chrome Extension (MV3) | Traffic interception & replay |
| Language | TypeScript | Type-safe request/response schemas |
| Server | Node.js | Session storage & replay proxy |
| Monorepo | pnpm workspaces | Extension + server in one repo |
node >= 18.0.0
pnpm >= 8.0.0
Chrome browsergit clone https://github.com/Ap-0007/api-time-machine.git
cd api-time-machine
pnpm install
# Build the extension
pnpm build:extension
# Start the local server
pnpm start:server- Open Chrome →
chrome://extensions - Enable Developer mode
- Click Load unpacked → select
packages/extension/dist
api-time-machine/
├── packages/
│ ├── extension/ # Chrome extension (MV3)
│ │ ├── src/
│ │ │ ├── background.ts # Service worker
│ │ │ ├── content.ts # Page injection
│ │ │ └── devtools.ts # DevTools panel
│ │ └── manifest.json
│ └── server/ # Local replay server
│ ├── src/
│ │ ├── recorder.ts # Session storage
│ │ └── replay.ts # Proxy engine
│ └── package.json
├── pnpm-workspace.yaml
└── package.json
- Reproduce intermittent bugs — capture a session when it happens, replay anytime
- Demo specific flows — record a perfect user flow, replay it reliably in presentations
- API contract testing — record production responses, test against them locally
- Onboarding — share a session file so others can see exactly what the app looked like