| 1 | --- |
| 2 | title: "htmx.config.inlineScriptNonce" |
| 3 | description: "Nonce value added to inline scripts generated by htmx" |
| 4 | --- |
| 5 | |
| 6 | The `htmx.config.inlineScriptNonce` option sets the `nonce` attribute on inline `<script>` elements that htmx generates, for use with a Content Security Policy that requires script nonces. |
| 7 | |
| 8 | **Default:** `''` (empty string — no nonce added) |
| 9 | |
| 10 | ## Example |
| 11 | |
| 12 | ```javascript |
| 13 | htmx.config.inlineScriptNonce = "abc123"; |
| 14 | ``` |
| 15 | |
| 16 | ```html |
| 17 | <meta name="htmx-config" content='{"inlineScriptNonce":"abc123"}'> |
| 18 | ``` |
| 19 | |
| 20 | The nonce value should match the one provided in your `Content-Security-Policy` header. |
| 21 | |
| 22 | See also: [`htmx.config`](/reference/config/htmx-config) |