You are currently viewing documentation for version 14 of Next.js.
crossOrigin
Use the crossOrigin
option to add a crossOrigin
attribute in all <script>
tags generated by the next/script
and next/head
components, 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?