Skip to content

Using Stripe API Keys

tomer-stripe edited this page Oct 29, 2019 · 1 revision

The Stripe CLI supports several different ways to set and use API keys:

  1. stripe login
  2. --api-key flag
  3. environment variables

Each supports different use cases. stripe login should be used for most day-to-day use cases as it will persist your API key locally and not require passing it in.

--api-key is a global flag that will let you override the config if you need to run one-off commands with a specific API key.

Environment variables are useful for things like Docker containers where running the login flow is not easy. The two environment variables that STRIPE_API_KEY and STRIPE_DEVICE_NAME. Have these set will take precedence over all other values.