Skip to content

Chrome (MV3) extension: capture balances from provider pages - #10

Merged
jckail merged 1 commit into
masterfrom
feature/chrome-extension
Jul 9, 2026
Merged

Chrome (MV3) extension: capture balances from provider pages#10
jckail merged 1 commit into
masterfrom
feature/chrome-extension

Conversation

@jckail

@jckail jckail commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

Phase 4 multi-surface item — a Manifest V3 Chrome extension, the second consumer of @pointup/api-client (the whole reason that package exists). It reads the loyalty balance a provider page already shows the signed-in user and records it as a manual snapshot in PointUp — sync without sharing credentials.

provider page ──content script──▶ background worker ──@pointup/api-client──▶ PointUp API
  • src/extraction.ts — pure, unit-tested provider detection + balance extraction (no DOM, no chrome APIs) via a per-provider host/regex registry. This is the valuable, testable core; the rest is thin glue.
  • content script scrapes the visible page text → background worker matches provider → linked account and POSTs a manual balance via the typed client → popup holds settings (API URL + token) and the latest capture with one-click record.
  • Auth — bearer token (the same path mobile uses). No api-client refactor needed — it already supports baseUrl + headers.
  • CI builds the extension; docs/extension.md; README updated.

Safety

Never reads passwords/cookies/credential fields — only the balance number already on screen. Capture is one-click and user-initiated; no provider automation.

Verification

  • 123 tests pass (92 core + 20 bot + 11 extension); typecheck + eslint clean; npm run build --workspace @pointup/extension produces a loadable dist/ (bundles + manifest + popup).
  • A test asserts the manifest's content_scripts matches stay in sync with the extraction rules — adding a provider can't silently miss the manifest.

Follow-up

A full @clerk/chrome-extension sign-in flow (vs. pasting a token) is the natural next step; the client + capture pipeline are already token-driven.

🤖 Generated with Claude Code

Phase 4 multi-surface item — the second consumer of @pointup/api-client. Reads
the loyalty balance a provider page already shows the signed-in user and records
it as a manual snapshot in PointUp; no credentials shared.

- apps/extension: MV3 extension bundled with esbuild.
  - src/extraction.ts: pure, unit-tested provider detection + balance
    extraction (no DOM, no chrome APIs) with a per-provider host/regex registry.
  - content script (scrape visible text) → background worker (match provider →
    account, POST manual balance via the typed client) → popup (settings +
    latest capture + one-click record).
  - Bearer-token auth (same path as mobile); no api-client refactor needed —
    it already supports baseUrl + headers.
  - 11 tests, incl. a guard that the manifest content_scripts matches stay in
    sync with the extraction rules.
- CI builds the extension; docs/extension.md; README layout + docs list.

Verification: 123 tests pass (92 core + 20 bot + 11 extension); typecheck + lint
clean; extension build produces a loadable dist/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 9, 2026

Copy link
Copy Markdown

Bugbot is not enabled for this team, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@jckail
jckail merged commit 5fd37cc into master Jul 9, 2026
2 checks passed
@jckail
jckail deleted the feature/chrome-extension branch July 9, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant