Skip to main content
Solved

Should I save google apikey in my client app?


Forum|alt.badge.img+1

Hi, by configurating revenuecat I need to trigger following code:
 

configuration = PurchasesConfiguration(googleApiKey)  ..appUserID = userId  ..observerMode = false;

 

I have no experience and no idea if this google-api-key is important or should be privacy, should I hardcode this googleApiKey in my flutter app, or I need to get this from google secret manager via cloud function? But if I get this from cloud function, there is no chance for hacker to get this apikey?

thanks!

Best answer by Michael Fogel

Hey @x-936719 !

 

We have a useful guide on API Keys and where/how they should be used here. When configuring the SDK, you will need to use the API key associated with the platform that has been detected. So for Android, you would need the Android API key and for iOS you would need the Apple API key. 

 

For this you can use the public API key which can be public. These are not a security risk so you are fine to hardcode this! 

  • Public API keys (also known as App specific keys in the dashboard) are meant to make non-potent changes to subscribers, and must be used to configure the SDK. Each app under a project is automatically provided with a public API key.
View original
Did this post help you find an answer to your question?

2 replies

Michael Fogel
Forum|alt.badge.img+6
  • Dedicated Contributor
  • 382 replies
  • Answer
  • September 20, 2023

Hey @x-936719 !

 

We have a useful guide on API Keys and where/how they should be used here. When configuring the SDK, you will need to use the API key associated with the platform that has been detected. So for Android, you would need the Android API key and for iOS you would need the Apple API key. 

 

For this you can use the public API key which can be public. These are not a security risk so you are fine to hardcode this! 

  • Public API keys (also known as App specific keys in the dashboard) are meant to make non-potent changes to subscribers, and must be used to configure the SDK. Each app under a project is automatically provided with a public API key.

Forum|alt.badge.img+1
  • Author
  • New Member
  • 3 replies
  • September 20, 2023

Hi thanks for the reply, now I will easily hardcode the key in my app:)


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings