Genesys Messenger widget CORS error in Next.js SSR

Getting Access to XMLHttpRequest blocked by CORS policy when the Genesys Messenger widget tries to fetch config in a Next.js app. The issue only happens during server-side rendering. Client-side works fine. Here’s the setup:

const script = document.createElement('script');
script.src = 'https://webmessaging.genesyscloud.com/widget.js';
script.async = true;
document.body.appendChild(script);

The genesyscloud.com domain isn’t returning the Access-Control-Allow-Origin header for the initial config call. How do I bypass this or configure the widget to defer execution until the client mounts?