[Vuejs]-No token Provided (vue stripe)

0👍

On the server you need to initialise Stripe with your secret key, which you don’t appear to be doing here.

const stripe = require('stripe')('your-secret-key')

Details can be found in the Stripe docs: https://stripe.com/docs/api/authentication?lang=node

EDIT: After explanation in the comments, it appears that the OP has not used a dotenv file, which mean process.env.STRIPE_SECRET_KEY is null, hence the error.

Recommended reading: https://www.npmjs.com/package/dotenv

Leave a comment