just worked this out. You need:
window._grecaptcha_callback = () => {
window.grecaptcha.render({
sitekey: grecaptcha_key,
badge: 'bottomleft',
})
window.grecaptcha.ready(() => {
// grecaptcha is ready
})
}
Then load the script as https://www.google.com/recaptcha/api.js?onload=_grecaptcha_callback
.
With this the way you call execute has to change slightly to simply
window.grecaptcha.execute(0, {action})
eg. 0
instead of the site key as the first argument.
Looking through the code there are a number of other undocumented settings:
sitekey, type, theme, size, tabindex, stoken, bind, preload, badge, s, pool, 'content-binding', action
But apart fromt sitekey
and badge
I don't know what they do. But they probably correspond roughly to the settings for v2.