feat(paddle): wire frontend overlay to /api/billing/config#141
Open
Rasbandit wants to merge 6 commits into
Open
feat(paddle): wire frontend overlay to /api/billing/config#141Rasbandit wants to merge 6 commits into
Rasbandit wants to merge 6 commits into
Conversation
Replaces the stale Stripe-style frontend with Paddle.js overlay checkout. Adds `@paddle/paddle-js` and a `useBillingConfig` hook that fetches `/api/billing/config` (token, environment, price IDs, customer email, custom_data). `BillingPage` initializes Paddle once on config load and `Paddle.Checkout.open` runs on plan-card click with `customer`, `customData`, and a `successUrl` back to `/billing?status=success`. Buttons stay disabled until the Paddle instance resolves. Portal button still hits `/api/billing/portal` (server returns the hosted Paddle URL); "Manage subscription in Stripe" copy stripped. Backend cutover landed in #132. Plan: docs/superpowers/plans/ 2026-05-14-paddle-frontend-overlay.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Registers `paddle-docs` HTTP MCP server (hosted by Kapa.ai at paddlehq.mcp.kapa.ai) in repo `.mcp.json` so Claude can query live Paddle documentation during integration work. Checks in the handoff plan that drove the frontend rewrite shipped in the prior commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Single-repo port of the workspace Makefile. Drops `cd backend/` prefixes (backend is the repo root here), strips `plugin-*` targets (plugin lives in a separate repo), and swaps frontend `npm` for `bun` to match the repo's lockfile choice (#35 / 6ac17fa). Targets that referenced missing scripts (test_plan.sh, deploy.sh, e2e/unit_tests) are omitted rather than ported broken. Top targets for local dev: - `make dev` / `make dev-selfhost` — Phoenix at :4000 / :4001 with the matching .env.local file. - `make frontend-dev` — Vite hot-reload at :5173. Phoenix watchers are disabled in config/dev.exs to avoid orphan node processes, so this is opt-in. - `make backend-up/down` — full Docker stack (docker-compose.elixir). - `make help` — auto-generated target listing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@paddle/paddle-js dynamically loads paddle.js from cdn.paddle.com, opens the checkout iframe on (sandbox-)buy.paddle.com, and talks to (sandbox-)api.paddle.com. The strict CSP installed by the SPA pipeline blocked all three, so the overlay never rendered. Wildcard `https://*.paddle.com` covers cdn / buy / sandbox-buy / api / sandbox-api in one entry. Same change applies to script-src, connect-src, and frame-src. img-src already permits `https:`, style-src already has 'unsafe-inline'. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Captures state post PR #141 so brainstorming can resume after /compact: PR status, current Paddle sandbox resources, codebase facts already gathered (router, AuthGuard, no TOS tracking), and the clarifying questions queued for the user. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Rasbandit
added a commit
that referenced
this pull request
May 15, 2026
Also includes fix on top: AgreementPage navigates to /onboard after acceptance so OnboardRedirect can forward to billing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
billing-page.tsxaround@paddle/paddle-jsoverlay — fetch/api/billing/config,initializePaddle,Paddle.Checkout.openwithcustomer/customData/successUrl.useBillingConfig()React Query hook withstaleTime: Infinity(per-session immutable).https://*.paddle.comin the SPA CSP (script-src,connect-src,frame-src) — the overlay loads fromcdn.paddle.com, renders an iframe onsandbox-buy.paddle.com, and callssandbox-api.paddle.com. The previous CSP blocked all three.Makefileported fromengram-workspace(dropscd backend/prefixes, swapsnpm→bun, strips plugin-only targets)..mcp.json(paddle-docs MCP server) and the design handoff plan atdocs/superpowers/plans/2026-05-14-paddle-frontend-overlay.md.Backend cutover landed in #132; this PR is the frontend half.
Test plan
bun run buildandtsc --noEmitclean.mix compile --warnings-as-errorsclean./billingrenders Starter + Pro cards, no "Stripe" copy anywhere.4242 4242 4242 4242— Paddle createdsub_01krn5g6t9stkvmkzwq2r1vh50for user 14, statustrialing, period end2026-05-22.subscription.createdwebhook delivered through cloudflared tunnel → row landed insubscriptions(tier=starter, status=trialing, paddle_customer_id + paddle_subscription_id populated)./billingflipped to "Free Trial" + "7 days remaining" + "Manage subscription" link./api/billing/portalredirected to a Paddle-hosted portal session.Out of scope (follow-up PRs)
customData.billing-page.tsxyet; backend has full webhook + event coverage in feat(paddle): replace Stripe with Paddle (MoR) end-to-end #132).🤖 Generated with Claude Code