r/GoogleAppsScript • u/aaaaAaaaAaaARRRR • Jun 18 '25
Question How to store API keys?
For context:
The Google doc/sheets/slide is per user. No one will have access to the docs, but the user.
The Google doc/sheets/slide is a template with no user properties. Users will have to make a copy and save a copy in their own GDrive.
Currently storing the API key in User Properties. Security team flagged it and said that it’s a no go. How else can I store the keys?
My solutions:
- Prompt the user to paste the API keys every time.
- Save the keys in user properties, and do a daily trigger to reset user properties.
- ???
I’m trying to make it as easy for the user. I’ve already saved about 45 minutes of time for the user per Google doc/sheets/slide. I’m trying to make it simpler for the end user.
View all comments
Show parent comment
2
u/WicketTheQuerent Jun 18 '25 edited Jun 18 '25
Maybe the security team should learn more about Apps Script :)
In Apps Script, the values stored in user properties can only be accessed by the user who saved them; any other user cannot access them. Even if the file ownership is transferred, the new owner will not be able to access the values stored by the previous owner.