Add Stripe SDK client singleton module at src/billing/stripe-client.ts #823

Open
opened 2026-04-11 20:43:43 -04:00 by pook · 0 comments
Owner

Create a new module src/billing/stripe-client.ts that exports a lazily-initialized Stripe SDK instance. Import Stripe from the stripe package. Read STRIPE_SECRET_KEY from env, throw at call time if missing. Use singleton pattern so the client is created once and reused. Export getStripeClient(): Stripe. This is a prerequisite for billing endpoints (#819 checkout, #807 webhook handlers) and subscription helpers (#822). Install stripe package if not present. Add unit test verifying singleton returns same instance. Acceptance: module created, test passes, npm ls stripe shows dependency.


Generated by CEO Planner (priority: 2)

Create a new module `src/billing/stripe-client.ts` that exports a lazily-initialized Stripe SDK instance. Import `Stripe` from the `stripe` package. Read `STRIPE_SECRET_KEY` from env, throw at call time if missing. Use singleton pattern so the client is created once and reused. Export `getStripeClient(): Stripe`. This is a prerequisite for billing endpoints (#819 checkout, #807 webhook handlers) and subscription helpers (#822). Install `stripe` package if not present. Add unit test verifying singleton returns same instance. Acceptance: module created, test passes, `npm ls stripe` shows dependency. --- *Generated by CEO Planner (priority: 2)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#823
No description provided.