{"id":23770,"date":"2022-09-07T10:23:45","date_gmt":"2022-09-07T10:23:45","guid":{"rendered":"https:\/\/refiner.io\/docs\/?post_type=knowledgebase&#038;p=23770"},"modified":"2025-09-08T13:32:55","modified_gmt":"2025-09-08T13:32:55","slug":"content-security-policy","status":"publish","type":"knowledgebase","link":"https:\/\/refiner.io\/docs\/kb\/javascript-client\/content-security-policy\/","title":{"rendered":"Content Security Policy"},"content":{"rendered":"\n<p><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/CSP\" target=\"_blank\" rel=\"noreferrer noopener\">Content Security Policy (CSP)<\/a> is an added layer of security that helps to detect and mitigate Cross-Site Scripting (XSS) and data injection attacks. <\/p>\n\n\n\n<p>If your web-app or website is using CSP, you&#8217;ll need to add the following domain names to your policy.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">script-src: js.refiner.io\nconnect-src: api.refiner.io\nframe-src: js.refiner.io\nframe-ancestors: js.refiner.io\nimg-src: js.refiner.io storage.refiner.io\nmedia-src: js.refiner.io storage.refiner.io\nstyle-src: js.refiner.io storage.refiner.io<\/pre>\n\n\n\n<p>Please note: If you are loading our JavaScript SDK with the <a href=\"https:\/\/refiner.io\/docs\/kb\/install-client\/javascript\/\">copy &amp; paste method<\/a> while using CSP headers, we invite you to put the Refiner code snippet in a separated JavaScript file. You can then load the JavaScript file with a &lt;script src=&#8221;refiner-code-snippet.js&#8221;>&lt;\/script> HTML tag and add the &#8216;self&#8217; keyword to the script-src CSP header.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate Cross-Site Scripting (XSS) and data injection attacks. If your web-app or website is using CSP, you&#8217;ll need to add the following domain names to your policy. Please note: If you are loading our JavaScript SDK with the copy &amp; [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"https:\/\/refiner.io\/docs\/kb\/javascript-client\/content-security-policy\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","template":"","knowledgebase_tag":[],"class_list":["post-23770","knowledgebase","type-knowledgebase","status-publish","hentry","knowledgebase_cat-javascript-client"],"featured_image_urls_v2":{"full":"","thumbnail":"","medium":"","medium_large":"","large":"","1536x1536":"","2048x2048":"","ab-block-post-grid-landscape":"","ab-block-post-grid-square":"","gb-block-post-grid-landscape":"","gb-block-post-grid-square":""},"post_excerpt_stackable_v2":"<p>Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate Cross-Site Scripting (XSS) and data injection attacks. If your web-app or website is using CSP, you&#8217;ll need to add the following domain names to your policy. script-src: js.refiner.io connect-src: api.refiner.io frame-src: js.refiner.io frame-ancestors: js.refiner.io img-src: js.refiner.io storage.refiner.io media-src: js.refiner.io storage.refiner.io style-src: js.refiner.io storage.refiner.io Please note: If you are loading our JavaScript SDK with the copy &amp; paste method while using CSP headers, we invite you to put the Refiner code snippet in a separated JavaScript file. You can then load the JavaScript file with&hellip;<\/p>\n","category_list_v2":"","author_info_v2":{"name":"Moritz Dausinger","url":"https:\/\/refiner.io\/docs\/author\/user\/"},"comments_num_v2":"0 comments","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Content Security Policy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/refiner.io\/docs\/kb\/javascript-client\/content-security-policy\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Content Security Policy\" \/>\n<meta property=\"og:description\" content=\"Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate Cross-Site Scripting (XSS) and data injection attacks. If your web-app or website is using CSP, you&#8217;ll need to add the following domain names to your policy. Please note: If you are loading our JavaScript SDK with the copy &amp; [...]Read More...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/refiner.io\/docs\/kb\/javascript-client\/content-security-policy\/\" \/>\n<meta property=\"og:site_name\" content=\"Refiner Documentation\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-08T13:32:55+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/refiner.io\/docs\/kb\/javascript-client\/content-security-policy\/\",\"url\":\"https:\/\/refiner.io\/docs\/kb\/javascript-client\/content-security-policy\/\",\"name\":\"Content Security Policy\",\"isPartOf\":{\"@id\":\"https:\/\/refiner.io\/docs\/#website\"},\"datePublished\":\"2022-09-07T10:23:45+00:00\",\"dateModified\":\"2025-09-08T13:32:55+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/refiner.io\/docs\/kb\/javascript-client\/content-security-policy\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/refiner.io\/docs\/kb\/javascript-client\/content-security-policy\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/refiner.io\/docs\/kb\/javascript-client\/content-security-policy\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/refiner.io\/docs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Content Security Policy\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/refiner.io\/docs\/#website\",\"url\":\"https:\/\/refiner.io\/docs\/\",\"name\":\"Refiner Documentation\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/refiner.io\/docs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/refiner.io\/docs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/refiner.io\/docs\/#organization\",\"name\":\"Refiner Documentation\",\"url\":\"https:\/\/refiner.io\/docs\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/refiner.io\/docs\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/refiner.io\/docs\/wp-content\/uploads\/2022\/11\/cropped-Group-8.png\",\"contentUrl\":\"https:\/\/refiner.io\/docs\/wp-content\/uploads\/2022\/11\/cropped-Group-8.png\",\"width\":400,\"height\":61,\"caption\":\"Refiner Documentation\"},\"image\":{\"@id\":\"https:\/\/refiner.io\/docs\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Content Security Policy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/refiner.io\/docs\/kb\/javascript-client\/content-security-policy\/","og_locale":"en_US","og_type":"article","og_title":"Content Security Policy","og_description":"Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate Cross-Site Scripting (XSS) and data injection attacks. If your web-app or website is using CSP, you&#8217;ll need to add the following domain names to your policy. Please note: If you are loading our JavaScript SDK with the copy &amp; [...]Read More...","og_url":"https:\/\/refiner.io\/docs\/kb\/javascript-client\/content-security-policy\/","og_site_name":"Refiner Documentation","article_modified_time":"2025-09-08T13:32:55+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/refiner.io\/docs\/kb\/javascript-client\/content-security-policy\/","url":"https:\/\/refiner.io\/docs\/kb\/javascript-client\/content-security-policy\/","name":"Content Security Policy","isPartOf":{"@id":"https:\/\/refiner.io\/docs\/#website"},"datePublished":"2022-09-07T10:23:45+00:00","dateModified":"2025-09-08T13:32:55+00:00","breadcrumb":{"@id":"https:\/\/refiner.io\/docs\/kb\/javascript-client\/content-security-policy\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/refiner.io\/docs\/kb\/javascript-client\/content-security-policy\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/refiner.io\/docs\/kb\/javascript-client\/content-security-policy\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/refiner.io\/docs\/"},{"@type":"ListItem","position":2,"name":"Content Security Policy"}]},{"@type":"WebSite","@id":"https:\/\/refiner.io\/docs\/#website","url":"https:\/\/refiner.io\/docs\/","name":"Refiner Documentation","description":"","publisher":{"@id":"https:\/\/refiner.io\/docs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/refiner.io\/docs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/refiner.io\/docs\/#organization","name":"Refiner Documentation","url":"https:\/\/refiner.io\/docs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/refiner.io\/docs\/#\/schema\/logo\/image\/","url":"https:\/\/refiner.io\/docs\/wp-content\/uploads\/2022\/11\/cropped-Group-8.png","contentUrl":"https:\/\/refiner.io\/docs\/wp-content\/uploads\/2022\/11\/cropped-Group-8.png","width":400,"height":61,"caption":"Refiner Documentation"},"image":{"@id":"https:\/\/refiner.io\/docs\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/refiner.io\/docs\/wp-json\/wp\/v2\/knowledgebase\/23770","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/refiner.io\/docs\/wp-json\/wp\/v2\/knowledgebase"}],"about":[{"href":"https:\/\/refiner.io\/docs\/wp-json\/wp\/v2\/types\/knowledgebase"}],"author":[{"embeddable":true,"href":"https:\/\/refiner.io\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/refiner.io\/docs\/wp-json\/wp\/v2\/comments?post=23770"}],"version-history":[{"count":12,"href":"https:\/\/refiner.io\/docs\/wp-json\/wp\/v2\/knowledgebase\/23770\/revisions"}],"predecessor-version":[{"id":27584,"href":"https:\/\/refiner.io\/docs\/wp-json\/wp\/v2\/knowledgebase\/23770\/revisions\/27584"}],"wp:attachment":[{"href":"https:\/\/refiner.io\/docs\/wp-json\/wp\/v2\/media?parent=23770"}],"wp:term":[{"taxonomy":"knowledgebase_tag","embeddable":true,"href":"https:\/\/refiner.io\/docs\/wp-json\/wp\/v2\/knowledgebase_tag?post=23770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}