import Stripe from "stripe";

const key = process.env.STRIPE_SECRET_KEY;
if (!key && process.env.NODE_ENV === "production") {
  // Don't crash dev, but require for prod.
  throw new Error("STRIPE_SECRET_KEY is required in production");
}

export const stripe = new Stripe(key ?? "sk_test_dummy_for_build", {
  apiVersion: "2024-11-20.acacia",
});
