Open reiz opened 2 weeks ago
Hello @reiz,
thank you for your message. To load it on demand using this framework you would need to load the script tag into the DOM manually, as a module import won't work here. You can hook yourself into the onload event of this script and then access the API object from the client.
This is similar to the manual integration process: https://docs.captchafox.com/getting-started#manual-integration
First of all, thanks for providing a really great captcha solution, hosted in Germany!!
I'm using it in a Ruby on Rails application withe Hotwire Turbo and Stimulus.JS. I would like to load CaptchaFox on demand, from a Stimulus Controller like this:
But that doesn't work. Always getting:
Cannot use import statement outside a module
. What I'm doing wrong? How can I load and render it on demand? Without putting this line into my templates:Any input is appreciated.