From 920fdc60078c739aa7b100ecfad24644245ca14f Mon Sep 17 00:00:00 2001 From: realaravinth Date: Wed, 15 Dec 2021 15:20:01 +0530 Subject: [PATCH] add links to various browser-oriented libs from mcaptcha --- content/docs/API/browser.md | 40 +++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/content/docs/API/browser.md b/content/docs/API/browser.md index 54e6531..e6b47ff 100644 --- a/content/docs/API/browser.md +++ b/content/docs/API/browser.md @@ -1,5 +1,5 @@ --- -title: "Browser library" +title: "Browser libraries" description: "API documenttion for mCaptcha WASM library" lead: "" date: 2021-03-11 @@ -13,10 +13,42 @@ weight: 110 toc: true --- +The browser part of mCaptcha is divided into three components. + +- Glue code +- Widget program +- Proof-of-Work libraries(WebAssembly and JavaScript polyfill) + +## Glue code + +This is the code that links mCaptcha with your website's frontend code. +It creates an `iframe` containing the mCaptcha widget and injects the +received verification proof token into a hidden input field. + +Support is available for various frameworks, see +[`mCaptcha/glue`](https://github.com/mCaptcha/glue) for the full list. + +For frameworks without official support, a low-level library, +[`@mcaptcha/core-glue`](https://www.npmjs.com/package/@mcaptcha/core-glue), +can be used to implement support. + +## Widget Program + +This part is served by the mCaptcha backend. It fetches PoW config from +the backend, generates proof and submits it for verification. If +verification is successful, it sends a message containing the +verification proof token to the parent window, assuming it's loaded as +an `iframe`. + +- Source code: + [`mCaptcha/mCaptcha/templates/widget`](https://github.com/mCaptcha/mCaptcha/tree/master/templates/widget) + WebAssembly library which generates Proofs of Work for mCaptcha systems. +## Proof-of-Work(PoW) library -## Versions +WebAssembly bindings([`mCaptcha/pow_wasm`](https://github.com/mCaptcha/pow_wasm)) are available for the main rust library([`mCaptcha/pow_sha256`](https://github.com/mCaptcha/pow_sha256)). -- [master-branch](https://mcaptcha.github.io/browser/mCaptcha_browser/index.html) -- [0.1.0](/api-docs/browser/0.1.0/mCaptcha_browser/index.html) +For browsers without support WebAssembly, a +polyfill([`pow_sha256-polyfill`](https://github.com/mCaptcha/pow_sha256-polyfill)) +is available.