What I’m trying to do:
Do API calls from the client side that require API keys. These are keys that are not user-specific, rather the same keys are used for every user.
What I’ve tried and what’s not working:
Made API calls from server functions and storing the keys in the secrets service. It works, just not what I’m after.
I have seen some posts here with people making API calls from the client side, but I don’t understand how people are managing their API keys on the client side. I understand that when keys/tokens are user specific, it is ok to call a server function to work with them in the client side code. Server code can work with the anvil secrets service.
But I don’t know how to handle general app secrets on the client side, considering client code is untrusted. I probably shouldn’t return an app secret to client code, or am I missing something?
Do I just stick to using server functions in this scenario?