Skip to content

Add Polar billing emulator and release 0.15.0 - #23

Closed
joelbqz wants to merge 1 commit into
UsefulSoftwareCo:mainfrom
joelbqz:polar-emulator
Closed

Add Polar billing emulator and release 0.15.0#23
joelbqz wants to merge 1 commit into
UsefulSoftwareCo:mainfrom
joelbqz:polar-emulator

Conversation

@joelbqz

@joelbqz joelbqz commented Sep 6, 2026

Copy link
Copy Markdown

Adds @emulators/polar (npx emulate --service polar): a stateful emulator for the subscription and usage-based billing surface applications use through @polar-sh/sdk.

  • Customers with external ids (Polar's exact 422 messages for duplicate email / external id), meters with filters and aggregations, event ingestion, meter credit and custom benefits, products with fixed or metered prices and trials.
  • Subscriptions: server-side creation for free products only, product changes with next_period pending updates, cancel at period end, revoke; customer state with active subscriptions, granted benefits, and meter balances; customer meters.
  • Hosted checkout that upgrades a free subscription in place via subscription_id, with settlement deferred until POST /checkout/:secret/settle (or an auto-settle delay), and customer portal sessions.
  • Faults and the request ledger key on Polar's real operation ids (customers:get_state_external, events:ingest, ...).
  • Registry entry, skill, docs, README, and a test suite driving the real SDK against the emulator.
  • Version bump to 0.15.0 with the changelog entry, so merging publishes.

Verified: turbo run build type-check lint test --filter=@emulators/polar --filter=@executor-js/emulate --filter=web passes, and the executor cloud billing e2e scenarios pass against this emulator.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EjMMoUk6xckQ7FX87nrNdZ

A stateful emulator for the subscription and usage-based billing surface
applications use through @polar-sh/sdk: customers with external ids, meters,
event ingestion, meter credit and custom benefits, products with fixed or
metered prices and trials, subscriptions with pending updates, customer state
with meter balances, hosted checkout with controllable settlement, customer
sessions and portal. Faults and the ledger key on Polar's real operation ids.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EjMMoUk6xckQ7FX87nrNdZ
@joelbqz joelbqz closed this Sep 6, 2026
@joelbqz
joelbqz deleted the polar-emulator branch September 6, 2026 18:15
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