stripe / stripe-cli

A command-line tool for Stripe
https://stripe.com/docs/stripe-cli
Apache License 2.0
1.57k stars 362 forks source link

Create .env file with pub key placeholder #1202

Closed etsai2-stripe closed 2 weeks ago

etsai2-stripe commented 2 weeks ago

Reviewers

r? @vcheung-stripe cc @stripe/developer-products

Summary

Samples were downloaded without .env file configured if the user is not logged in. The instruction to set up the .env file was not clear. We will configure .env file with test pub key placeholder and ask user to update it manually after.

Download sample with test mode pub key

$ stripe samples create starter
✔ Finished downloading
✔ Selected server: node
✔ Files copied
✔ Project configured
You're all set. To get started: cd starter
$ more starter/server/.env
STATIC_DIR="../client"
STRIPE_PUBLISHABLE_KEY="pk_test_51Of62wKYULnmyk0cBSrGl1xAx5l8tgArWiuu7vyXwapv6raNDE3ZWAb2cmKLEHJZxCnEMABHHXAyw04kuxXsqTWr00wOe2XCGG"
STRIPE_SECRET_KEY="rk_test_[redacted]"
STRIPE_WEBHOOK_SECRET="whsec_[redacted]"

Download sample without test mode pub key

$ stripe samples create starter
✔ Finished downloading
✔ Selected server: node
✔ Files copied
⚠️ Project configured without testmode publishable key. Please update your pk_test... key in the .env file in the server folder
You're all set. To get started: cd starter
$ more starter/server/.env
STATIC_DIR="../client"
STRIPE_PUBLISHABLE_KEY="pk_test..."
STRIPE_SECRET_KEY="rk_test_[redacted]"
STRIPE_WEBHOOK_SECRET="whsec_[redacted]"