Just use <Head></Head>
import Head from 'next/head' <Head> <script async src="https://script.magicchat.ai/js/widget-raw.min.js" id="6b946b67-60c0-4b77-8384-d95a27088361"></script> </Head>
learn more about next/head https://nextjs.org/docs/api-reference/next/head