close
Skip to content
This page is also available as Markdown at /docs/pages/api-reference/config/next-config-js/crossOrigin.md. For an index of Next.js Pages Router documentation, see /docs/pages/llms.txt.
You are currently viewing the documentation for Pages Router.

crossOrigin

Last updated April 15, 2025

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

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

Options

Was this helpful?

supported.