Commerce Chrome Extension

Complete rewrite of a legacy browser extension with modern tooling and improved developer experience

View project

Info

Client: Sovrn
Year: 2022

Tech Stack

TypeScript

React

Vite

Chrome APIs

Zustand

Datadog

Sovrn Commerce Chrome Extension - Affiliate link management

Commerce Chrome Extension

Download from Chrome Web Store

A complete rewrite of Sovrn Commerce’s browser extension, replacing a legacy JavaScript codebase with modern TypeScript architecture and streamlined CI/CD.

Role: Lead Engineer

The Challenge

The existing Chrome Extension had accumulated years of technical debt. The codebase was vanilla JavaScript without type safety, making refactoring risky and onboarding new developers slow. The build system was a custom Webpack configuration that few understood, and there was no automated testing or deployment pipeline—releases required manual intervention and were error-prone.

User feedback indicated the extension was slow and occasionally buggy, but the codebase made it difficult to diagnose issues or ship fixes confidently.

Technical Approach

Architecture

I rewrote the extension from scratch with a focus on maintainability and developer experience:

  • TypeScript Everywhere: Full type coverage including background scripts, content scripts, and popup UI
  • React + Zustand: Component-based UI with lightweight state management
  • Vite Build System: Sub-second hot module reloading during development
  • Chrome Storage Sync: State persistence across browser sessions using Chrome’s storage API

Extension Architecture

Chrome extensions have unique constraints—code runs in multiple isolated contexts (popup, background service worker, content scripts) that must communicate via message passing.

ContextResponsibility
PopupReact UI for link creation and management
BackgroundService worker handling API calls and auth state
Content ScriptPage context for product detection and price scraping

I implemented a typed message-passing system that provided compile-time guarantees for cross-context communication, eliminating a class of runtime errors that plagued the legacy extension.

CI/CD Pipeline

Automated pipeline replacing manual release process:

  • PR Validation: Linting, type checking, and unit tests on every pull request
  • E2E Testing: Puppeteer-based integration tests against staging environment
  • Chrome Web Store Deployment: Tagged releases automatically submit to Chrome Web Store review
  • Datadog Integration: Real user monitoring for performance and error tracking

Technical Decisions

DecisionRationale
Vite over WebpackDramatically faster builds; native ESM support; simpler configuration
Zustand over ReduxSmaller bundle, simpler API, native Chrome storage middleware
@crxjs/vite-pluginFirst-class Vite support for Chrome extensions with HMR
TypeScript strict modeCatch errors at compile time; self-documenting code

Impact

  • Improved developer velocity — new features ship faster with confidence
  • Reduced bug reports — TypeScript and automated testing caught issues before release
  • Faster onboarding — typed codebase with clear architecture reduced ramp-up time for new engineers
  • Consistent releases — automated pipeline eliminated manual deployment errors

Product Showcase

Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4

More work

View all work
American Whitewater

American Whitewater

Full-stack platform modernization and offline-first mobile app for the nation's leading whitewater conservation organization

Sovrn Commerce iOS

Sovrn Commerce iOS

Native iOS app enabling content creators to manage affiliate links on mobile, generating new revenue for the platform

Commerce JS

Commerce JS

A next-generation JavaScript ecosystem that modernized how Sovrn Commerce builds client-side applications.