Skip to content

Commit

Permalink
Re-add the procaptcha window var (#1036)
Browse files Browse the repository at this point in the history
* Re-add the procaptcha window var

* lint:fix
  • Loading branch information
forgetso authored Feb 12, 2024
1 parent be21e08 commit 25674b0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/procaptcha-bundle/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,16 @@ export default function ready(fn: () => void) {
}
}

// extend the global Window interface to include the procaptcha object
declare global {
interface Window {
procaptcha: { ready: typeof ready; render: typeof render }
}
}

// set the procaptcha attribute on the window
window.procaptcha = { ready, render }

// onLoadUrlCallback defines the name of the callback function to be called when the script is loaded
// onRenderExplicit takes values of either explicit or implicit
const { onloadUrlCallback, renderExplicit } = extractParams(BUNDLE_NAME)
Expand Down

0 comments on commit 25674b0

Please sign in to comment.