diff --git a/lib/src/script.ts b/lib/src/script.ts index 4e75055..f1cc955 100644 --- a/lib/src/script.ts +++ b/lib/src/script.ts @@ -34,7 +34,7 @@ export function fetchScript({ const onComplete = (event, callback) => { try { - if (cleanup) { + if (!secureApi && cleanup) { element.removeChild(script); } callback(event); diff --git a/package.json b/package.json index 3c878f0..e84012b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@hcaptcha/loader", "description": "This is a JavaScript library to easily configure the loading of the hCaptcha JS client SDK with built-in error handling.", - "version": "1.2.0", + "version": "1.2.1", "author": "hCaptcha team and contributors", "license": "MIT", "keywords": [