From Rude Cheetah, 6 Years ago, written in Plain Text.
Embed
  1.     renderCaptcha()  {
  2.         const recpatcha = window['grecaptcha'];
  3.         console.log(typeof recpatcha.render);
  4.         if (typeof recpatcha.render !== "function") {
  5.             console.log('waiting till captcha is found');
  6.             this.timeout = setInterval(() => {
  7.                 this.renderCaptcha();
  8.               }, 200)
  9.               return;
  10.         }
  11.         clearTimeout(this.timeout);
  12.         recpatcha.render(this.element.shadowRoot.querySelector('#captcha'), {
  13.             sitekey: '6Lf_op4UAAAAANXxRYbfMkXbR4CnXwI520y9JiWc',
  14.  
  15.             callback: function(response){
  16.                 console.log('got cpatch response', response);
  17.             }
  18.         });
  19.     }
  20.  
  21.     componentDidLoad() {
  22.         this.renderCaptcha();
  23.     }