I’m trying to integrate with Vapi. Vapi needs to send call transcripts back to my app via a webhook.
The main problem is that Vapi’s webhook requests are getting a 401 “Unauthorized” error and aren’t reaching my Next.js application at all.
Here’s some helpful info:
- My Next.js app has a webhook endpoint at
/api/vapi-webhook
. - When I trigger a call through Vapi, my app successfully makes an API call to Vapi to start the interview.
- However, when Vapi tries to send the transcript back to my
/api/vapi-webhook
endpoint, it fails. I’ve confirmed this because there are absolutely no logs from my webhook handler code in the Next.js terminal output (no “received request,” no “checking secret,” nothing). This means the request is being blocked before it even hits my application logic. - My Next.js development server (
npm run dev
) is running correctly. The terminal logs show it starts successfully and listens internally on port 9002. (The Cloud Workstation environment seems to force this internal port, even if I try to set it to 6000 in mypackage.json
). - The public URL for my workstation that Vapi is trying to reach uses port 6000 (e.g.,
https://6000-firebase-studio-....cloudworkstations.dev/api/vapi-webhook
). The idea is that the workstation should forward traffic from this external port 6000 to my app’s internal port 9002. - The Blocker: Firebase Studio has a “BACKEND PORTS” UI panel where you can see running servers and make their ports “public” (which should open the necessary network path). However, this panel consistently says “no running servers found,” even though my Next.js server is definitely running on port 9002 according to the terminal.
- Because the “BACKEND PORTS” UI doesn’t detect my server, I can’t use its “Make public” feature for port 9002. Without this step, the Cloud Workstation’s default network security is likely blocking Vapi’s external requests.
We’ve tried various application code adjustments (like ensuring the Vapi webhook secret validation is in place, tweaking Next.js port configurations, and setting allowedDevOrigins
), but these don’t solve the core problem of the server not being detected by the Firebase Studio “BACKEND PORTS” UI, which is needed to open up external access.
So, the current roadblock seems to be an issue with the Firebase Studio tooling/environment not recognizing my running Next.js server, preventing me from configuring the network accessibility needed for the Vapi webhook.
Any ideas on why Firebase Studio might not be detecting a running server on port 9002, or alternative ways to configure port forwarding/public access in a Cloud Workstation environment when the built-in UI isn’t cooperating?"