AI-powered smart replies for WhatsApp Web and Facebook Messenger using Google Gemini API.
- Semi-Auto Reply Mode - Click "✨ Reply with AI" button to generate contextual replies
- Multi-Platform Support - Works with WhatsApp Web, Facebook Messenger, and Facebook chat popups
- Conversation Context - Sends up to 15 recent messages to Gemini for contextual replies
- Keyword Rules - Set up automatic replies for specific keywords/phrases
- Custom System Prompt - Personalize AI behavior and tone
- Webhook Integration - Send conversation data to external CRM/systems
- Smart Input Detection - Automatically finds and types into chat input boxes
- Open Chrome and navigate to
chrome://extensions/ - Enable Developer mode (toggle in top-right corner)
- Click Load unpacked
- Select the
ai-auto-reply-extensionfolder - The extension icon should appear in your toolbar
Coming soon
-
Get a Gemini API Key:
- Visit Google AI Studio
- Create a new API key
- Copy the key
-
Configure Extension:
- Click the extension icon in Chrome toolbar
- Paste your Gemini API Key
- Toggle "Enable Auto Reply" ON
- Customize settings (optional)
-
Start Using:
- Open WhatsApp Web or Facebook Messenger
- You'll see a green "✨ Reply with AI" button at bottom-right
- Click it anytime to generate a contextual reply
- Click the button → Extension collects conversation history
- AI analyzes context → Sends to Gemini API with full conversation
- Reply typed → AI-generated text appears in input box
- You review & send → Manually press Enter to send
The extension sends conversation history to Gemini in this structured format:
ROLE: You are a helpful customer support assistant...
CONVERSATION HISTORY (most recent messages, in order):
────────────────────────────────────
👤 Customer: Hello, do you have this in stock?
🤖 You: Yes, we have it available. Would you like to order?
👤 Customer: How much is shipping?
────────────────────────────────────
TASK: The customer's latest message is: "How much is shipping?"
Write a natural reply based on the full conversation above.
RULES:
- Reply in the SAME LANGUAGE the customer is using
- Keep it brief and conversational (1-3 sentences)
- Be contextually relevant to what was discussed
- Do NOT include any label, prefix, or emoji at the start
- Just output the reply text, nothing else
| Setting | Description |
|---|---|
| Gemini API Key | Your Google Gemini API key (required) |
| System Prompt | Customize AI personality and behavior |
| Reply Delay | Seconds to wait before typing (legacy setting) |
Set up automatic replies for common queries:
| Keyword | Auto-Reply |
|---|---|
| "price" | "Our prices start at $10. What are you looking for?" |
| "hours" | "We're open 9AM-6PM daily" |
| "hello" | "Hi there! How can I help you today?" |
Send conversation data to external systems:
- Webhook URL - Your endpoint to receive message data
- Trigger - Sends data when AI reply is generated
| Platform | URL Pattern | Status |
|---|---|---|
| WhatsApp Web | https://web.whatsapp.com/* |
✅ Full support |
| Facebook Messenger | https://www.messenger.com/* |
✅ Full support |
| Facebook Chat Popup | https://www.facebook.com/* |
✅ Full support |
┌─────────────┐ ┌──────────────┐ ┌─────────────────┐
│ Popup UI │────▶│ Background │────▶│ Gemini API │
│ (settings) │ │ (service │ │ (Google AI) │
└─────────────┘ │ worker) │ └─────────────────┘
│ └──────────────┘ ▲
│ ▲ │
▼ │ │
┌─────────────┐ │ ┌──────┴──────────┐
│ Content │───────────┘ │ Reply Text │
│ Script │ (GET_AI_REPLY) │ (typed to UI) │
│ (WhatsApp/ │◀──────────────────────────┘ │
│ Facebook) │ │
└─────────────┘ │
▲ │
│ │
└──────────────────────────────────────────────────┘
ai-auto-reply-extension/
├── manifest.json # Extension manifest (v3)
├── background.js # Service worker - API calls, webhooks
├── content.js # Content script - UI injection, chat detection
├── popup.html # Extension popup UI
├── popup.js # Popup logic
├── styles.css # Popup styling
├── icons/
│ ├── icon16.png # Toolbar icon (16x16)
│ ├── icon48.png # Extension icon (48x48)
│ └── icon128.png # Store icon (128x128)
└── README.md # This file
storage- Save settings locallyactiveTab- Access current tab for debuggingscripting- Inject content scriptstabs- Query and message all tabshost_permissions:web.whatsapp.com/*- WhatsApp Web accessfacebook.com/*- Facebook Messenger accessmessenger.com/*- Messenger accessgenerativelanguage.googleapis.com/*- Gemini API
- Make sure you're on
facebook.com(notmessenger.com) - Open a chat popup by clicking a conversation
- Look for the green "✨ Reply with AI" button at bottom-right
- If missing, refresh the page (F5)
- Extension was updated/reloaded
- Solution: Refresh the page (F5)
- Click inside the chat input box first
- Then click "Reply with AI" button
- If still failing, try refreshing the page
- Click extension icon in toolbar
- Enter your Gemini API key in the settings
- Toggle "Enable Auto Reply" ON
- Refresh WhatsApp/Messenger page
- Clone or download the extension folder
- Load unpacked in Chrome (see Installation)
- Edit files and reload extension to test changes
Open browser console (F12 → Console) and filter by [AI Auto Reply] to see debug logs.
// Check if content script loaded
console.log('[AI Auto Reply]', 'Manual test');
// Find input box manually
document.querySelectorAll('div[contenteditable="true"]');- API Key Storage: Your Gemini API key is stored locally in Chrome's storage (not sent to any server)
- Conversation Data: Messages are sent to Google's Gemini API for generating replies
- Webhook Data: Only sent if you configure a webhook URL
- No Analytics: Extension does not track usage or send analytics
MIT License - Feel free to modify and distribute.
- Initial release
- WhatsApp Web support
- Facebook Messenger support
- Facebook chat popup support
- Semi-auto "Reply with AI" button
- Conversation context for Gemini
- Keyword rules
- Webhook integration
- Custom system prompts
For issues or feature requests:
- Check the Troubleshooting section above
- Review console logs for error messages
- Ensure API key is valid and has quota remaining
Made with ❤️ for smarter conversations