How to hide stripe key via .env

Viewed 22

How can I hide the stripe secret key with .env?

on the real code it's write like this in Server.js file: const stripe = require("stripe")("sk_test_XXXXXXXXXXXXXXXXXXXXXXXXX");

I tried to do something like this: const stripe = require("stripe")(process.env.STRIPE_KEY);

and the secret key is on .env file(STRIPE_KEY=sk_test_XXXXXXXXXXXXXXXXXXXXXXXXX), but it doesn't work...

0 Answers
Related