getStripeConfig (stripe-config.ts)

zentable · payments, stripe-config, env-mode-switching, price-selection

Stripe Configuration - Environment-aware price selection Automatically switches between test and live prices based on NODE_ENV and STRIPE_MODE /

/**
 * Stripe Configuration - Environment-aware price selection
 * Automatically switches between test and live prices based on NODE_ENV and STRIPE_MODE
 */

export interface StripePriceConfig {
  lite: string
  plus: string 
  pro: string
}

export interface StripeConfig {
  prices: StripePriceConfig
  isLive: boolean
  mode: 'test' | 'live'
  secretKey: string | null
  publishableKey: string | null
  webhookSecret: string | null
}

// Test prices (for development) - Updated to use prices that exist in your test account
const TEST_PRICES: StripePriceConfig = {
  lite: 'price_1RtWl99MDLdB3mTb8iBxZYaY',  // $5/month - 1,000 credits
  plus: 'price_1RtWlA9MDLdB3mTbqz1qLDT5',  // $10/month - 2,500 credits
  pro: 'price_1RtWlA9MDLdB3mTbUMunPLQH'    // $20/month - 7,500 credits
}

// Live prices

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key