CORS error on Genesys Messenger widget in Next.js

Embedding the Genesys Cloud Messenger widget in our Next.js app is throwing a CORS error on the initial handshake. The widget loads fine in a static HTML test page, but inside the React component it fails to reach the edge server. Here’s the error I’m seeing in the console:

Access to script 'https://api.mypurecloud.com/api/v2/messenger/widgets' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I’ve checked the widget configuration and the domain is whitelisted in the admin UI. The purecloud-messenger npm package is installed via npm install @genesys/purecloud-messenger. Is there a specific server-side proxy setup needed for Next.js to handle the initial token exchange, or am I missing a header config in the widget init call?