Skip to main content
Chrome Extensions have special security constraints. Our SDK provides a dedicated transport layer that handles message passing between content scripts, background scripts, and web pages.

Why Composite for Chrome Extensions?

The Composite Analytics SDK includes first-class support for Chrome Extensions with:
  • Automatic Content Script Transport - Handles message passing between isolated contexts
  • Session Recording - Capture user interactions across all tabs
  • User Identification - Identify users across extension contexts
  • Manifest V3 Support - Built for modern Chrome Extension architecture

Architecture

Chrome extensions require a two-part architecture for analytics:
  1. Content Script - Runs on web pages, captures session recordings and events
  2. Background Script - Service worker that handles API communication on behalf of content scripts
This separation is required because content scripts cannot make direct network requests to external APIs due to Chrome’s security model.

Best Practices

Minimize Permissions

Only request the permissions your extension actually needs

Mask Sensitive Data

Use selectors to mask passwords, credit cards, and PII in recordings

Handle Errors

Implement error boundaries and fallbacks for SDK failures

Identify Users

Always identify logged-in users to connect their sessions

What’s Next?