Skip to content
This page is also available as Markdown: request this page's URL with an Accept: text/markdown header. For an index of Next.js documentation, see /docs/llms.txt.

crossOrigin

Last updated June 16, 2025

Use the crossOrigin option to add a crossOrigin attribute in all <script> tags generated by the next/script component , and define how cross-origin requests should be handled.

next.config.js
module.exports = {
  crossOrigin: 'anonymous',
}

Options

Was this helpful?

supported.