0.1.0-alpha-5 • Published 6 months ago
@mcaptcha/core-glue v0.1.0-alpha-5
Usage
A custom glue implementation
const instanceUrl = "https://api.mcaptcha.org";
const siteKey: g.SiteKey = {
key: "randomSitekeyasShowninmCaptchaDashboard",
instanceUrl: new URL(instanceUrl),
};
/** callback function to update hidden input field. Varies for each
* framework/ glue implementation
*/
const cb = (token: string): void {
let input = document.getElementById("mcaptcha__token");
if (input) {
input.value = token;
}
}
const config: g.WidgetConfig = {
siteKey,
};
const r = new Receiver(config, cb.setToken);
// register listener when component is mounted/necessary HTML for
// callback function is rendered
r.listen();
// teardown
r.destroy();
0.1.0-rc3
6 months ago
0.1.0-rc1
7 months ago
0.1.0-rc2
6 months ago
0.1.0-alpha-4
2 years ago
0.1.0-alpha-5
2 years ago
0.1.0-alpha-3
2 years ago
0.1.0-alpha-2
2 years ago
0.1.0-alpha-1
2 years ago