CORS Error on Genesys Messenger Widget in Next.js App

I’m trying to embed the Genesys Cloud Messenger widget in a Next.js app. The script loads fine in the browser console, but when I deploy to Vercel, I get a CORS error on the initial API call.

Access to fetch at 'https://api.mypurecloud.com/api/v2/conversations' from origin 'https://myapp.vercel.app' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Is there a specific header I need to set in the widget config? Or is this a Next.js proxy issue? I’ve tried adding the origin to the allowed list in Genesys settings but it’s not helping.

The widget shouldn’t call /api/v2/conversations directly from the browser anyway. That’s a backend endpoint. You’re likely misconfiguring the widget init script or trying to fetch data client-side. Check the Messenger docs for the correct messengerId and organizationId config. Don’t bypass the widget’s internal logic.