Search code examples
javascriptreactjsrecaptcha

How to hide reCaptcha-v2 SITE_KEY in React app


I'm building an app using React and trying to implement google reCaptcha-v2 in one of the pages, but I want to make sure the "SITE_KEY" given by Google cloud console will not be visible to anyone.

Where or how should I hide this key?


Solution

  • but I want to make sure the "SITE_KEY" given by google cloud console will not be visible to anyone

    You can't, nor do you need to. It isn't a secret.

    Only the secret key needs to be kept secret.