utils/stripe-authentication.ts

issuing-treasury · _base/src/utils/stripe-authentication.ts · typescript · MIT
payments

Utility to fetch Stripe secret and publishable keys per platform from environment variables.

// Source: https://github.com/stripe-samples/issuing-treasury | License: MIT | Copyright 2022 Stripe
// Provided via justclaw.it.com; keep this notice with the code.
import { PlatformStripeAccount } from "./account-management-helpers";

const getStripeSecretKey = (platform: PlatformStripeAccount): string | null => {
  let key;

  switch (platform) {
    // @if financialProduct==embedded-finance
    case PlatformStripeAccount.US:
      // Don't put any keys in code. Use an environment variable (as shown
      // here) or secrets vault to supply keys to your integration.
      //
      // See https://docs.stripe.com/keys-best-practices and find your
      // keys at https://dashboard.stripe.com/apikeys.
      key = process.env.STRIPE_SECRET_KEY_US || process.env.STRIPE_SECRET_KEY;
      brea

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

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

Get a free API key