Use of Library
Rendering can be achieved by specifying your onload callback function and adding parameters to the JavaScript resource.

Renders the container as a reCAPTCHA widget and returns the ID of the newly created widget.
The HTML element to render the reCAPTCHA widget. Specify either the ID of the container (string) or the DOM element itself.
An object containing parameters as key=value pairs, for example, {"sitekey": "your_site_key", "theme": "light"}. See grecaptcha.render parameters.