#Milan-Koladiya

1 messages · Page 1 of 1 (latest)

gloomy harborBOT
pallid isle
#

Hi there!

vague vector
#

Hello Soma
Thanks for you replay

pallid isle
#

Is your question how to pass/store the Stripe secret API key in Axios?

vague vector
#

I am using create customer endpoint with axios

pallid isle
#

I'm not at all familiar with Axios, but I see a similar question on StackOverflow. Here's the answer:

You can't make server-side API calls to Stripe from the client side, and you should never (ever [ever ever]) put your Secret Key in client-side code.
https://stackoverflow.com/a/62253924/17427213

vague vector
#

okay, thank you @pallid isle

tulip bear
#

👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

vague vector
#

yes, thank you @tulip bear

#

I am using stripe endpoint with Axios for create a customer in reactjs without backend so I pass the header in Axios
{ authorization: "Bearer SECRET KEY" }

so i need to hide the secret key because anyone gets the secret key in network tab and he can get the user details

tulip bear
#

unfortunately that's a really terrible idea to do and we don't recommend it at all

#

the only to do that without a backend is to create a "setup" Checkout Session

vague vector
#

so i think, without a backend not possiable

#

right?

tulip bear
#

correct

vague vector
#

okay, Thank you! @tulip bear

tulip bear
#

let me know if you need any more help

vague vector
#

no, Thanks!