Glue

Code to embed mCaptcha widget

mCaptcha widget should be loaded within an iframe

  1. The user clicks on the validation button
  2. The widget(within the iframe) computes proof-of-work
  3. Sends it to the mCaptcha (backend)instance
  4. If proof is valid, mCaptcha instance will send a verification token
  5. Widget sends parent webpage(webpage containing the iframe) a message containing the verification token
  6. Glue code receives message and embeds the token in a hidden input field with name and ID mcaptcha__token

The glue code is responsible receiving and embedding the token and optionally create the iframe itself.

Framework Support

To provide a smooth migration experience, glue code is implemented for the following frameworks. If you wish to see your framework supported, please open an issue!

Framework Source Code Documentation npm package name
Vanilla JavaScript(No Framework) packages/vanilla
React JS packages/react
Next.JS packages/react
Svelte JS packages/svelte

Core library

Framework-specific implementation provide markup(HTML) and hooks into reactive state, the core functionality is implemented in @mcaptcha/core-glue.

To implement glue for an unsupported framework, checkout @mcaptcha/core-glue.

Funding

NLnet

NLnet NGIZero logo

2023 development is funded through the NGI0 Entrust Fund, via NLnet. Please see here for more details.

Top categories

Loading Svelte Themes