Skip to main content

Chrome Extension (chrome-shrine)

The Shrine Chrome Extension provides contextual health AI directly in your browser.

Features

  • Shrine AI Chat — Ask health questions from any webpage
  • Food Logging — Log meals with AI-powered macro analysis
  • Diet Score — Real-time diet score and gap tracking
  • Context Awareness — Extension reads page context for relevant suggestions

Architecture

The extension communicates with The Shrine backend via the Extension API. Authentication uses Clerk JWT tokens stored in the extension’s secure storage.
chrome-shrine/
  src/
    background/    # Service worker, auth management
    content/       # Content scripts, page context extraction
    popup/         # Popup UI (React + Vite)
    sidepanel/     # Side panel for chat interface
  manifest.json    # Chrome Extension Manifest V3

Development

cd apps/chrome-shrine
npm install
npm run dev       # Watch mode, builds to dist/
npm run test      # Vitest
npm run lint      # ESLint + TypeScript
Load dist/ as an unpacked extension in Chrome (chrome://extensions with Developer Mode).

API Contract

The extension API contract is CI-enforced via OpenAPI spec. See Extension Contract for the full specification. Any backend API changes trigger make openapi-check in CI.