Appearance
ADR 0006: Polar deferred to milestone 5
- Status: Superseded by ADR 0010
- Date: 2026-11-18
- Spec version: 1.0.0
Context
The scaffold wired the Polar Better Auth plugin with a placeholder product id, createCustomerOnSignUp: true, a required POLAR_ACCESS_TOKEN, and a "Pro" upgrade button. In this product, payment belongs to a lead (before any account exists) and the client account is created after payment. Crew, sales and owner users must never become Polar customers. The spec also requires a manual "record payment" fallback that runs the same path.
Decision
Remove Polar from auth, the Worker's environment, the env schema and the web app now. Keep a PaymentProvider interface with an unconfiguredPayments implementation in packages/api/src/integrations. Add Polar in milestone 5 as a server-side provider (checkout link from the frozen contract amount, webhook that marks the lead Paid), with the manual path calling the same function.
Consequences
- Developers need no Polar token to run the app.
- The
@polar-sh/*dependencies were removed; they come back withbun addin milestone 5. - Polar's sandbox/production switch (previously hard-coded to
sandbox) becomes an explicit setting at that point.
Revisit when
Milestone 5 starts, or the owner picks a different provider (the interface exists for that).