npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

google-meeting-captions-resolver

v2.0.0

Published

a tool to get google meeting captions for chrome extension

Readme

🎯 Google Meeting Captions Resolver

Real-time caption extraction for Google Meet - Perfect for building Chrome extensions, accessibility tools, live translations, and meeting assistants!

npm version License: ISC

✨ Features

  • 🚀 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

📦 Installation

npm install google-meeting-captions-resolver

or

yarn add google-meeting-captions-resolver

🚀 Quick Start

import { getCaptions } from 'google-meeting-captions-resolver';

getCaptions('', (captions) => {
  console.log(`${captions.activeSpeaker}: ${captions.talkContent}`);
  // Output: "John Doe: Hello everyone, welcome to the meeting!"
});

📖 API Reference

getCaptions(cls: string, receiver: captionsReceiver): void

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:

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
}

💡 Usage Examples

Basic Chrome Extension

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)
  });
});

Live Translation

import { getCaptions } from 'google-meeting-captions-resolver';

getCaptions('', async (captions) => {
  // Translate captions in real-time
  const translated = await translateText(captions.talkContent, 'es');
  displayTranslation(translated);
});

Meeting Transcription

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);
});

Accessibility Enhancement

import { getCaptions } from 'google-meeting-captions-resolver';

getCaptions('', (captions) => {
  // Display captions in a custom, larger font
  const captionElement = document.getElementById('custom-captions');
  captionElement.innerHTML = `
    <strong>${captions.activeSpeaker}:</strong>
    <span style="font-size: 24px">${captions.talkContent}</span>
  `;
});

🏗️ How It Works

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

🎯 Use Cases

  • 📝 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

🔧 Browser Compatibility

Works in all modern browsers that support:

  • MutationObserver API
  • WeakMap
  • ES2015+

Tested on:

  • ✅ Chrome 90+
  • ✅ Edge 90+
  • ✅ Firefox 88+
  • ✅ Safari 14+

📝 TypeScript Support

Full TypeScript definitions are included:

import { getCaptions, Captions, captionsReceiver } from 'google-meeting-captions-resolver';

const handleCaptions: captionsReceiver = (captions: Captions) => {
  // Your code here with full type safety
};

getCaptions('', handleCaptions);

🤝 Contributing

Contributions are welcome! Feel free to:

  • 🐛 Report bugs
  • 💡 Suggest new features
  • 🔧 Submit pull requests

Visit our GitHub repository to get started.

📄 License

ISC License - see LICENSE for details.

🙏 Acknowledgments

Built with ❤️ for developers creating amazing Google Meet extensions and accessibility tools.

📮 Support


Happy coding! 🚀 If this library helps you, consider giving it a ⭐ on GitHub!