Skip to main content

Package Reference

Overview of shared packages in the LightningAddon monorepo. Apps (main, popup, in-page, background) import from these packages; packages depend on each other via the dependency graph.

Generated API docs: Run pnpm docs:api in the product repo to generate TypeDoc API documentation locally. Output is in docs/api-generated/ — for local reference only, not published.

Core Packages

@repo/core

Domain layer and typed runtime messaging.

  • Exports: sendRuntimeMessage, addRuntimeMessageListener, RuntimeMessageMap, storage helpers, billing types, data models
  • Depends on: @repo/browser-utils
  • Used by: All apps that send or handle runtime messages

See Runtime Messages and Core Package for API details.

@repo/auth

Provider-agnostic authentication.

  • Exports: createAuth, AuthProvider, useAuth, AuthGuard, LoginForm, ClientAuth interface
  • Depends on: @repo/integrations, @repo/firebase, @repo/supabase
  • Used by: apps/popup, apps/main

Switches between Supabase, Firebase, and Custom backends via VITE_BACKEND env var. See Auth Architecture and Using with an Existing Backend for Custom mode.

@repo/ui

Shared React components.

  • Exports: BillingCard, ProfileCard, SettingsForm, useSettings
  • Depends on: @repo/auth, @repo/core, @repo/browser-utils
  • Used by: apps/popup, apps/main

React-specific. For Vue, Svelte, or Angular, build equivalents or use @repo/core + @repo/auth directly. See Framework Switching.

@repo/browser-utils

Type-safe Chrome/Firefox API wrappers.

  • Exports: getExtensionApi, getStorageValue, setStorageValue, runStorageMigrations, createRuntimeMessenger, storage and runtime helpers
  • Depends on: None (framework-agnostic)
  • Used by: @repo/core, @repo/auth, @repo/ui, apps/background

All storage access, runtime messaging, and browser API calls go through this package. See Storage Migrations.

@repo/integrations

Environment parsing and external SDK wiring.

  • Exports: parseIntegrationEnv, createStripe, env types
  • Depends on: Zod for validation
  • Used by: @repo/auth, apps/background

Single source of truth for which backend (Supabase/Firebase/Custom) and Stripe config are active. Validates env at runtime.

Backend Packages

@repo/firebase

Firebase client factory and Vite singleton.

  • Used by: @repo/auth, apps/background (when Firebase backend is active)

@repo/supabase

Supabase client factory and cookie-based session restore.

  • Used by: @repo/auth, apps/background (when Supabase backend is active)

Config & Tooling

@repo/vite-config

Vite configuration factory.

  • Exports: createViteConfig(appRoot, options?)
  • Options: framework: 'react' | 'vue' | 'svelte' | 'vanilla'
  • Used by: All extension apps (main, popup, in-page, background)

@repo/tailwind-config

Shared Tailwind CSS 4 + DaisyUI 5 entry point.

@repo/tooling

CLI binaries for extension packaging.

  • repo-assemble — Assembles extension from app builds into apps/extension/dist
  • repo-manifest-lint — Checks manifest permission policy
  • Used by: apps/extension package scripts

See Extension Assembly and Manifest Permissions.

@repo/assets

Static icons and images for the extension.