CORS blocking Messenger widget embed in Next.js SSR

Trying to drop the Genesys Messenger widget into a Next.js app (App Router). Getting a CORS error on the initial handshake when the page renders server-side.

The widget script tag loads fine in the _document, but the fetch to the widget config endpoint fails with Access-Control-Allow-Origin missing.

I’ve tried adding headers in middleware, but Next.js seems to strip them for static assets. Is there a specific meta tag or SDK init param to bypass this for SSR?

GET https://widget.genesyscloud.com/config net::ERR_FAILED 403