Gemini 2.0 implementation

Is there a better way to use gemini , without exposing api key directly in frontend for websocket connection?