This page is also available as Markdown at /docs/app/api-reference/config/next-config-js/crossOrigin.md. For an index of all documentation, see /docs/llms.txt.
crossOrigin
Last updated April 10, 2026
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
'anonymous': AddscrossOrigin="anonymous"attribute.'use-credentials': AddscrossOrigin="use-credentials".
Was this helpful?