as the title says, dos anyone know a way how to call functions I define in opa from external scripts or embeded content on the client side.
In other words, the opposite direction of what is explained in the 8. Hello, reCaptcha (and the rest of the world) example.
In my special case I got an interactive, embeded plugin from where i can call js functions defined in the browser context. But how do I need to define them in opa, so I can call them.
Yes, one of the difficulties is to guess the name of the Opa-generated functions in JS.
In Opa, there is a directive @js_ident such that @js_ident(“name_of_a_function”) is the string of the function at runtime. I think, this doesn’t help you much, though.
However, I think you can expose in JS a registering function (that puts its argument in reference), and call it from Opa with the Opa function you want to call as argument.