# Source: https://nextjs.org/docs/pages/api-reference/config/next-config-js/crossOrigin.md

# Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/crossOrigin.md

# Source: https://nextjs.org/docs/pages/api-reference/config/next-config-js/crossOrigin.md

# Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/crossOrigin.md

# Source: https://nextjs.org/docs/pages/api-reference/config/next-config-js/crossOrigin.md

# Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/crossOrigin.md

# Source: https://nextjs.org/docs/pages/api-reference/config/next-config-js/crossOrigin.md

# Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/crossOrigin.md

# Source: https://nextjs.org/docs/pages/api-reference/config/next-config-js/crossOrigin.md

# Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/crossOrigin.md

# crossOrigin
@doc-version: 16.0.4


Use the `crossOrigin` option to add a [`crossOrigin` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) in all `<script>` tags generated by the [`next/script`](/docs/app/guides/scripts.md) component , and define how cross-origin requests should be handled.

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

## Options

* `'anonymous'`: Adds [`crossOrigin="anonymous"`](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin#anonymous) attribute.
* `'use-credentials'`: Adds [`crossOrigin="use-credentials"`](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin#use-credentials).