Extension Integration
Build Chrome browser extensions with Reclaim Protocol verification capabilities
Overview
Build browser extensions with Reclaim verification in popup/sidepanel. The SDK handles Chrome Manifest V3 complexity including service workers, offscreen documents, and content script orchestration.
Primary Integration Path: This is the main way to use the SDK. Users trigger verification from your extension UI (popup/sidepanel). For triggering verification from a website, see Web Integration.
When to Use Extension Integration
Choose this integration approach if you are:
- π§ Building a browser extension from scratch or adding to an existing one
- π― Controlling the entire user experience within your extension
- π Creating popup or side panel interfaces that trigger verification
- π οΈ Developing productivity tools that need provider data verification
What You'll Build
By following this guide, you'll create a browser extension that can:
- Trigger Reclaim verification flows from extension popups or side panels
- Manage provider authentication tabs automatically
- Generate cryptographic proofs using WebAssembly
- Handle verification completion events
- Securely communicate between extension components
Architecture Overview
Extension integration involves three main components:
Components Explained
Extension Popup/Panel
- Your extension's user interface (HTML/CSS/JS)
- Initiates verification requests
- Displays results and handles user interactions
Background Service Worker
- Chrome Manifest V3 background script
- Coordinates between all components
- Manages extension lifecycle and permissions
Content Script Bridge
- Injected into web pages
- Enables communication with provider pages
- Handles message routing
Offscreen Document
- Hidden document for WebAssembly execution
- Generates cryptographic proofs
- Required for Manifest V3 architecture
Provider Tab
- Automatically opened during verification
- Hosts the provider authentication flow
- Monitored by network interceptor
Integration Steps
The integration process consists of four main steps:
1. Manifest Configuration
Configure your Chrome extension's manifest.json with required permissions, content security policies, and web-accessible resources.
2. Background Initialization
Initialize the SDK in your background service worker to enable offscreen document management and message handling.
3. Content Script Loading
Load the SDK's content script bridge to enable communication between your extension and web pages.
4. Implement Verification Flow
Use the SDK's API in your popup or panel to trigger verification and handle results.
Prerequisites
Before starting, ensure you have:
- β Completed the Installation guide
- β Obtained API credentials from the API Key guide
- β Basic understanding of Chrome extension development
- β Familiarity with JavaScript Promises and async/await
- β A Chrome extension project with Manifest V3
Security Considerations
Content Security Policy
The SDK requires specific CSP settings for WebAssembly execution:
Why wasm-unsafe-eval? This directive is required for WebAssembly instantiation in Manifest V3. While the name includes "unsafe," it's the only way to run WebAssembly in Chrome extensions and is considered acceptable for this specific use case.
Permissions
The SDK needs specific permissions:
offscreen: Create offscreen documents for proof generationcookies: Access provider cookies during verification<all_urls>: Inject content scripts and intercept network requests
Best Practices
- Never expose credentials in client code: Use environment variables or secure configuration
- Validate all user inputs: Before passing to verification flows
- Handle errors gracefully: Implement proper error boundaries
- Clear sensitive data: After verification completes
- Use server-side validation: For production deployments
For production applications, generate verification requests server-side and only pass the configuration to the client. This prevents exposure of your application secret. Learn more about server-side configuration (coming soon).
Browser Compatibility
This integration works with Chromium-based browsers supporting Manifest V3:
| Browser | Minimum Version | Status |
|---|---|---|
| Chrome | 93+ | β Fully Supported |
| Edge | 93+ | β Fully Supported |
| Brave | Latest | β Fully Supported |
| Opera | Latest (Chromium) | β Fully Supported |
| Firefox | - | β³ Coming Soon |
| Safari | - | β³ Coming Soon |
Example Extension
For a complete working example, check out our sample extension (link to be added).
Next Steps
Start with manifest configuration: