The goal of this library is to use React Native SSE and Expo FileSystem instead of polyfills to support calling the OpenAI API directly from React Native with streaming and file upload support. The package uses the same types and API as the OpenAI Node SDK wherever possible.
This package is meant to be used with a proxy to OpenAI like the one Backmesh provides. The baseURL parameter for this OpenAI client is thus mandatory. If you do not use a proxy and set the baseURL to https://api.openai.com/v1, you are basically exposing your Open AI API key on the internet! You should never expose any secrets in the bundle of a web or mobile app. The correct usage of this client is to create an endpoint on a proxy server for communication with Open AI and then use that endpoint with a user generated auth JWT in your app.
If you would like to contribute or request a feature, please join our Discord and ask questions in the #openai-react-native channel or create a pull request or issue.