Skip to content
/ glue Public

glue code to setup mCaptcha on your website

Notifications You must be signed in to change notification settings

mCaptcha/glue

Repository files navigation

Glue

Code to embed mCaptcha widget

0.1.0 Build) codecov

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 0.1.0 NPM
React JS packages/react 0.1.0 NPM
Next.JS packages/react 0.1.0 NPM
Svelte JS packages/svelte 0.1.0 NPM

Core library

NPM

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.