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