首页 > 解决方案 > How to hide an API key on client side?

问题描述

I know I'm not supposed to put API keys in the client side, but I can't think of a way around it. I am trying to integrate Google Pay on a website, and the payment processor is Paysafe. The Google Pay code is on the client side, and it requires the Paysafe API key (which needs to be kept secret) in the code.

Is it safe to put the API key in a json file on the server, and call that file for the key when it's required? Or is it still going to be exposed to the client?

标签: javascriptapi

解决方案


尝试使用代理服务器,您可以在其中保留 API 凭据。

在此处输入图像描述


推荐阅读