I integrated Chat Completions using a Swift package but realized storing the API key in the source code is insecure.
Then tried using Firebase Cloud Functions for server-side requests to chatgpt servers, but TypeScript/JS support seems lacking for completions as the streaming in the npm package for openai is stated to be not supported? Waiting for a completion result to complete would take too much time so the streaming of tokens back to a user's swiftui view is the objective.
Using the server to hold the api key then fetching it to the client i believe would be exposed in the networking aspect, so this is a route that also could be a vulnerability.
Is it true that current iOS apps utilizing the chat features at the moment have vulnerable API keys and there's no successful way to implement server-side operations for the chatgpt completions API?
Are there any known solutions at the moment? I'm so close to launching but these little hickups are quite the nuisance lol XD