a tool to get google meeting captions for chrome extension
npm install google-meeting-captions-resolver> Real-time caption extraction for Google Meet - Perfect for building Chrome extensions, accessibility tools, live translations, and meeting assistants!


- ð High Performance - Optimized with WeakMap and smart DOM tracking (7-10x faster than naive implementations)
- ðŊ Zero Data Loss - Captures every caption update in real-time, no debouncing
- ð Session Tracking - Automatically tracks speaker sessions with unique IDs
- ð Multi-language - Supports both English and Chinese Google Meet interfaces
- ðŠ TypeScript - Full type definitions included
- ðŠķ Lightweight - Minimal dependencies, small bundle size
``bash`
npm install google-meeting-captions-resolver
or
`bash`
yarn add google-meeting-captions-resolver
`typescript
import { getCaptions } from 'google-meeting-captions-resolver';
getCaptions('', (captions) => {
console.log(${captions.activeSpeaker}: ${captions.talkContent});`
// Output: "John Doe: Hello everyone, welcome to the meeting!"
});
Starts monitoring Google Meet captions and calls your receiver function whenever captions change.
Parameters:
- cls (string): Custom class name (currently unused, pass empty string '')receiver
- (function): Callback function that receives caption updates
Receiver Callback:
`typescript
type captionsReceiver = (captions: Captions) => void;
interface Captions {
session: string; // Unique session ID for this caption block
activeSpeaker: string; // Name of the current speaker
talkContent: string; // The caption text content
}
`
`typescript
import { getCaptions } from 'google-meeting-captions-resolver';
// Start capturing captions
getCaptions('', (captions) => {
// Send to your backend
fetch('/api/captions', {
method: 'POST',
body: JSON.stringify(captions)
});
});
`
`typescript
import { getCaptions } from 'google-meeting-captions-resolver';
getCaptions('', async (captions) => {
// Translate captions in real-time
const translated = await translateText(captions.talkContent, 'es');
displayTranslation(translated);
});
`
`typescript
import { getCaptions } from 'google-meeting-captions-resolver';
const transcript = new Map();
getCaptions('', (captions) => {
// Group by session ID
if (!transcript.has(captions.session)) {
transcript.set(captions.session, {
speaker: captions.activeSpeaker,
content: []
});
}
transcript.get(captions.session).content.push(captions.talkContent);
});
`
`typescript
import { getCaptions } from 'google-meeting-captions-resolver';
getCaptions('', (captions) => {
// Display captions in a custom, larger font
const captionElement = document.getElementById('custom-captions');
captionElement.innerHTML =
${captions.activeSpeaker}:
${captions.talkContent}
;`
});
This library uses the powerful MutationObserver API to monitor Google Meet's caption container in real-time:
1. Smart Detection - Automatically finds the caption container (supports multiple languages)
2. Efficient Tracking - Only processes changed nodes, not the entire DOM
3. Session Management - Uses WeakMap for O(1) lookups and automatic memory cleanup
4. Content Deduplication - Only triggers callbacks when content actually changes
- ð Meeting Transcription - Save and archive meeting conversations
- ð Live Translation - Translate captions to other languages in real-time
- âŋ Accessibility Tools - Enhance caption display for better readability
- ðĪ AI Assistants - Feed captions to AI for meeting summaries or action items
- ð Analytics - Track speaking time, keywords, and participation
- ð Education - Help students follow along in virtual classrooms
Works in all modern browsers that support:
- MutationObserver API
- WeakMap
- ES2015+
Tested on:
- â
Chrome 90+
- â
Edge 90+
- â
Firefox 88+
- â
Safari 14+
Full TypeScript definitions are included:
`typescript
import { getCaptions, Captions, captionsReceiver } from 'google-meeting-captions-resolver';
const handleCaptions: captionsReceiver = (captions: Captions) => {
// Your code here with full type safety
};
getCaptions('', handleCaptions);
``
Contributions are welcome! Feel free to:
- ð Report bugs
- ðĄ Suggest new features
- ð§ Submit pull requests
Visit our GitHub repository to get started.
ISC License - see LICENSE for details.
Built with âĪïļ for developers creating amazing Google Meet extensions and accessibility tools.
- ð Issues: GitHub Issues
---
Happy coding! ð If this library helps you, consider giving it a â on GitHub!