{"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"scripts","__idx":0},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["scripts"]}]},{"$$mdtype":"Tag","name":"ConfigOptionRequirements","attributes":{"products":["Redoc","Revel","Reef","Realm"],"plans":["Pro","Enterprise","Enterprise+"]},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Insert custom scripts in the head or body of a page."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"options","__idx":1},"children":["Options"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Option"},"children":["Option"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["head"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"#script-object"},"children":["Script object"]},"]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Inserts scripts in the head tags of the page."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["body"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"#script-object"},"children":["Script object"]},"]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Inserts scripts before the close body tag of the page."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"script-object","__idx":2},"children":["Script object"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Option"},"children":["Option"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["src"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["REQUIRED."]}," ","URL or path to script."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["inline"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["boolean"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Inlines the script content into the page."," ","Improves performance for small scripts."," ","Default: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["consent"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Loads the script only while the consent state allows the category."," ","In ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["opt-in"]}," mode the visitor must accept first."," ","In ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["opt-out"]}," mode the category starts on and stays on until the visitor refuses."," ","Needs the ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"/docs/realm/config/consent"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["consent"]}]}," option with a mode other than ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["none"]},"."," ","Needs the Enterprise+ plan."," ","Possible values: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["analytics"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["marketing"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["async"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["boolean"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Specifies to add the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["async"]}," attribute to the script tag."," ","Default: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["crossorigin"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Adds the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["crossorigin"]}," attribute with corresponding value to the script tag."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["defer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["boolean"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Specifies to add the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["defer"]}," attribute to the script tag."," ","Default: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["fetchpriority"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Adds the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fetchpriority"]}," attribute with corresponding value to the script tag."," ","Possible values: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["high"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["low"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["auto"]},"."," ","Default: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["auto"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integrity"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Adds the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["integrity"]}," attribute with corresponding value to the script tag."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["module"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["boolean"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Specifies to add the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["module"]}," attribute to the script tag."," ","Default: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["nomodule"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["boolean"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Specifies to add the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nomodule"]}," attribute to the script tag."," ","Default: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["nonce"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Adds the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nonce"]}," attribute with corresponding value to the script tag."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["referrerpolicy"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Adds the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["referrerpolicy"]}," attribute with corresponding value to the script tag."," ","Possible values: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["no-referrer"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["no-referrer-when-downgrade"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["origin"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["origin-when-cross-origin"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["same-origin"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["strict-origin"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["strict-origin-when-cross-origin"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["unsafe-url"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["''"]},"."," ","Default: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["strict-origin-when-cross-origin"]}," (with fallback to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["''"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["type"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Adds the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}," attribute with corresponding value to the script tag."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"examples","__idx":3},"children":["Examples"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"add-scripts-to-page-header-and-body","__idx":4},"children":["Add scripts to page header and body"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"scripts:\n  head:\n    - src: 'https://example.com/script.js'\n    - src: ./scripts/script.js\n  body:\n    - src: 'https://analytics.google.com/ga.js'\n      crossorigin: anonymous\n      defer: true\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This configuration produces the following script tags:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"html","header":{"controls":{"copy":{}}},"source":"  <script src=\"https://example.com/script.js\"></script>\n  <script src=\"/static/script.abf4dc37439374dfa2.js\"></script>\n</head>\n<body>\n  ...\n  <script src=\"https://analytics.google.com/ga.js\" crossorigin=\"anonymous\" defer>\n</body>\n","lang":"html"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"add-cookie-blocking-scripts","__idx":5},"children":["Add cookie blocking scripts"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following configuration adds OneTrust's Cookie Auto-Blocking script and an initialization script for OneTrust's cookie consent and privacy compliance platform:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","data-title":"redocly.yaml","header":{"title":"redocly.yaml","controls":{"copy":{}}},"source":"scripts:\n  head:\n    - src: https://cdn.cookielaw.org/consent/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/OtAutoBlock.js\n      type: text/javascript\n    - src: https://cdn.cookielaw.org/scripttemplates/otSDKStub.js\n      data-document-language: \"true\"\n      data-domain-script: aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\n      type: text/javascript\n      charset: UTF-8\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"resources","__idx":6},"children":["Resources"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"Link","attributes":{"href":"/docs/realm/config/links"},"children":["Configure links"]}]}," - Configure link behavior and styling to work seamlessly with custom scripts and interactive elements"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"Link","attributes":{"href":"/docs/realm/config"},"children":["Configuration options"]}]}," - Explore other project configuration options for comprehensive documentation and platform customization"]}]}]},"frontmatter":{"products":["Redoc","Revel","Reef","Realm"],"plans":["Pro","Enterprise","Enterprise+"],"description":"Insert custom scripts in the head or body of a page."},"tagList":["configOptionRequirements","table"],"title":"scripts","lastModified":"2026-09-25T14:05:50.000Z"}