huggingface / unity-api

Apache License 2.0
331 stars 32 forks source link

[QUESTION] #30

Open harshal-14 opened 6 days ago

harshal-14 commented 6 days ago

I have a simple game built in unity and I'm using this Hugging face API client for voice parsing. I'm trying to understand when I build and run the game, and want to distribute it to many users, how do I keep the same api key every time so that users can install and run voice control it without any issue?

StephenHodgson commented 6 days ago

ideally you don't ever wanna put your api key in the app anywhere.

What I usually do is use a reverse proxy with my own auth system (typically setup in firebase) and exchange my user session token with the real api key in my reverse proxy. This way I can also monetize the user access to the models.

harshal-14 commented 6 days ago

Can you help me understand how do you setup the reverse proxy and exchange user session token? I'm a beginner just trying to understand how to do this.