AI-powered Chrome extension for console debugging with PushEngage integration.
- Automatic Error Capture: Captures
console.error,console.warn, uncaught exceptions, and unhandled promise rejections - Real-time Detection: Errors appear instantly without page refresh
- Deduplication: Identical errors within 5 seconds are grouped
- AI Analysis: Get AI-powered explanations and solutions for any error
- Stack Trace Viewer: Expandable stack traces with file and line information
- SDK Detection: Automatically detects PushEngage SDK on any webpage
- Configuration Viewer: View and search through PE configuration data
- Natural Language Queries: Ask questions about your PE setup in plain English
- Campaign Overview: Summary cards for browse, cart, and custom trigger campaigns
- Quick Questions: Pre-built query suggestions for common questions
- OpenAI: GPT-4o, GPT-4-turbo, GPT-4, GPT-3.5-turbo
- Anthropic Claude: Claude 3.5 Sonnet, Claude 3 Opus, Claude 3 Sonnet, Claude 3 Haiku
- Google Gemini: Gemini 1.5 Pro, Gemini 1.5 Flash, Gemini Pro
- Streaming Responses: Real-time AI responses with streaming
-
Clone the repository
cd /Applications/pe/chrome-extensions\ debugger
-
Install dependencies
npm install
-
Build the extension
npm run build
-
Load in Chrome
- Open
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the
distfolder
- Open
npm run devThis starts Vite with HMR support for faster development.
- Visit OpenAI Platform
- Create a new API key
- Copy and paste into the extension settings
- Visit Anthropic Console
- Create a new API key
- Copy and paste into the extension settings
- Visit Google AI Studio
- Create a new API key
- Copy and paste into the extension settings
- Open any webpage
- Click the DevDebug AI extension icon
- Console errors will automatically appear in the Errors tab
- Click "Analyze" on any error to get AI assistance
- Ask follow-up questions in the Chat tab
- Navigate to a website with PushEngage installed
- The extension will automatically detect the PE SDK
- Go to the PE tab to view configuration
- Click "Ask AI" or use quick questions to query the data
- Get insights about campaigns, settings, and more
Debug Mode:
- "What's causing this TypeError?"
- "How do I fix this 'undefined is not a function' error?"
- "Explain this stack trace step by step"
- "Show me a code example to fix this"
PushEngage Mode:
- "Show me all active campaigns"
- "What are my cart abandonment settings?"
- "List all browse abandonment campaigns"
- "Is geo location enabled?"
- "What segments do I have configured?"
- "Explain my opt-in configuration"
src/
βββ content/
β βββ content.ts # Error capture + PE detection (MAIN world)
β βββ bridge.ts # Message relay (ISOLATED world)
βββ background/
β βββ background.ts # Service worker
βββ popup/
β βββ App.tsx # Main app component
β βββ components/ # React components
β βββ hooks/ # Custom hooks (useAIChat)
βββ services/
β βββ aiProvider.ts # AI API integration
β βββ pushEngage.ts # PE data service
βββ types/
β βββ index.ts # Core types
β βββ pushEngage.ts # PE types
βββ utils/
βββ storage.ts # Chrome storage utilities
βββ llm-providers.ts # AI provider configs
- Detection: The content script checks for
window.PushEngageevery 5 seconds - Fetching: When detected, calls
PushEngage.getAppConfig()to get configuration - Storage: Data is stored in
chrome.storage.local - Context Building:
PushEngageService.buildAIContext()formats data for AI prompts - Querying:
@tanstack/ai-clientreceives the full PE context and answers questions based on it
User Query β useAIChat Hook β buildSystemPrompt()
β
PushEngageService.buildAIContext(peData)
β
@tanstack/ai-client.chat.stream()
β
Streaming AI Response β UI
- β Local Storage Only: All data stays in your browser
- β No Telemetry: Zero tracking or analytics
- β Secure API Keys: Stored in Chrome's encrypted storage
- β Direct API Calls: Only communicates with your chosen AI provider
- β No Backend: Completely client-side
- React 18 - UI framework
- TypeScript - Type safety
- Tailwind CSS - Styling
- Vite - Build tool
- @crxjs/vite-plugin - Chrome extension build support
- @tanstack/ai-client - TanStack AI SDK for unified AI provider access
- Lucide React - Icons
- React Markdown - Markdown rendering
This extension uses @tanstack/ai-client from the TanStack AI SDK for all AI functionality:
import { createAIClient } from '@tanstack/ai-client';
// Create client with your provider
const client = createAIClient({
provider: 'openai', // or 'anthropic', 'google'
apiKey: 'your-api-key',
model: 'gpt-4o',
});
// Stream chat completions
await client.chat.stream({
messages: [{ role: 'user', content: 'Hello!' }],
onChunk: (chunk) => console.log(chunk.content),
});The TanStack AI SDK provides:
- Unified API across all providers (OpenAI, Anthropic, Google)
- Streaming support for real-time responses
- No vendor lock-in - easily switch providers
- Make sure you've run
npm run build - Check that you're loading the
distfolder - Try removing and re-adding the extension
- Verify your API key is correct
- Check that you have credits/quota with your provider
- Try the "Test Connection" button in settings
- Make sure the website has PushEngage SDK installed
- Wait a few seconds after page load
- Click "Refresh" in the PE panel
- Some errors may be caught by the page itself
- Cross-origin scripts may not show full details
- Check that the extension has permission for the site
- Fork the repository
- Create a feature branch
- Make your changes
- Run
npm run buildto test - Submit a pull request
MIT License - see LICENSE file for details.
Made with β€οΈ for developers