sb-google-recaptcha
v1.0.2
Published
Google Recaptcha as an HTML5 Custom Element
Downloads
4
Readme
Google-Recaptcha
Google-Recaptcha is a HTML5 Custom Element that empowers you to use the Google Recaptcha without knowing their API at all. It's easy as in pie.
For browsers who don't support native custom elements, You're gonna need to import a polyfill :(
API
class GoogleRecaptcha extends HTMLElement {
reset(): void
getResponse(): string
}
Example Usage
Every attribute other than the site key is optional.
<google-recaptcha theme="dark" type="image" sitekey="your-site-key-here"></google-recaptcha>
const captcha = document.createElement('google-recaptcha')
captcha.setAttribute('sitekey', 'your-site-key-here')
document.body.appendChild(captcha)
License
This project is licensed under the terms of MIT License, see the LICENSE file for more info.