CORS error on Genesys Messenger in Next.js App Router

Getting blocked by CORS when loading the Messenger widget in a Next.js 14 app. The browser console shows:

Access to script at 'https://messenger.mypurecloud.com/js/sdk.js' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present.

I’ve added the origin to the allowed list in the Genesys UI, but the fetch for the config still fails. Is there a specific header or proxy setup needed for the App Router? Here is the initialization code I’m using.