Skip to content
← Public packages

@kentcdodds/stripe

Stripe helpers for customers, payments, invoices, subscriptions, products, payment links, refunds, and balance.

src/smoke-test.ts

26 lines · 716 B · TypeScript
import { getAccount, getBalance } from './account.ts'
import { listCustomers } from './customers.ts'
import { listCharges } from './payments.ts'

/**
 * Read-only smoke test: account profile, balance, and small customer/charge
 * samples. Proves the stripeSecretKey secret, host approval, and auth header
 * work end-to-end without mutating any Stripe state.
 */
export async function smokeTest() {
	const [account, balance, customers, charges] = await Promise.all([
		getAccount(),
		getBalance(),
		listCustomers({ maxItems: 3 }),
		listCharges({ maxItems: 3 }),
	])
	return {
		ok: true,
		account,
		balance,
		customerSample: customers.customers,
		chargeSample: charges.charges,
	}
}

export default smokeTest