Set your secret
Ribaunt signs every challenge token with a secret you control. Add
RIBAUNT_SECRET to your server environment — a .env file, your hosting platform’s secrets manager, or however you manage server config.Create server endpoints
You need two endpoints: one that issues challenges and one that verifies solutions. Here’s a complete Express example using the
createChallenge and verifySolution functions from ribaunt.createChallenge accepts three parameters:| Parameter | Default | Description |
|---|---|---|
difficulty | 5 | Leading zeros required in the SHA-256 hash. Higher values increase solve time. |
amount | 4 | Number of challenge tokens to create. |
ttlSeconds | 30 | Challenge token lifetime in seconds. |
verifySolution returns a Promise<boolean>. It validates the JWT signature, checks expiry, confirms the nonce produces a hash with the required leading zeros, and blocks replay by default using process-local storage.Add the widget to your frontend
Include the Ribaunt web component script and place the If you’re using React, import the wrapper component instead of the web component directly. See React Integration for the full example.
<ribaunt-widget> element wherever you need CAPTCHA protection. The widget fetches a challenge from your server, solves it in the background, then calls your verify endpoint automatically when auto-verify="true" is set.The widget emits a
verify event when the challenge is solved. Use it to enable your submit button or proceed with form submission. A corresponding error event fires if verification fails, giving you a chance to surface feedback to the user.Next steps
Widget configuration
Explore all widget attributes — timeouts, theming, warning banners, and the
disabled state.React integration
Use the
ribaunt/widget-react wrapper with full prop support in React and Next.js App Router.Express server example
A production-ready Express server setup with replay protection and structured warning callbacks.