Open the page from where you need to copy the javascript code.
Copy the javascript code.
Paste it in your nextjs project as a new js file.
Script tag can be used to add the corresponding script to th eproject.

The <Script /> component requires the following properties:
- src- A path string specifying the URL of an external script. This can be either an absolute external URL or an internal path. The
srcproperty is required unless an inline script is used. - defer- defer can also be used along with script tag to parallelly run the code.