-
Copy
.env.exampleto.envand fill in your keys (do not commit.env).cp .env.example .env # edit .env -
Install dependencies and run the local proxy server (this requires Node 18+ for ESM support):
npm install npm run proxy
-
In the mobile app, set
PROXY_URLto the running proxy address (e.g.,http://192.168.x.x:3000/groqif using a physical device). Android emulator may use10.0.2.2as the host. -
Production (Vercel): If you deploy to Vercel, add a Serverless
api/groq.jsendpoint (it's already included underapi/groq.js).- Add
GROQ_API_KEYto Vercel's project Environment Variables (Production). - Set
PROXY_URLtohttps://<your-vercel-app>.vercel.app/api/groqin production if you want the mobile/web app to call the Vercel proxy.
- Add
-
Start the app as usual with:
npm run start
This app supports both direct calls to Groq (not recommended for production) and a local proxy that secures the API key.