Skip to main content
This guide walks you through building a complete Ribaunt CAPTCHA integration: two server endpoints that issue and verify proof-of-work challenges, plus a browser widget your users interact with. By the end you’ll have a working bot-protection layer you can drop in front of any form or API action.
1

Install Ribaunt

Add the ribaunt package to your project.
2

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.
Keep RIBAUNT_SECRET server-only. Never expose it to the browser. In Next.js, do not prefix it with NEXT_PUBLIC_ — that would embed the secret in your client bundle and allow anyone to forge valid challenge tokens.
3

Create server endpoints

You need two endpoints: one that issues challenges and one that verifies solutions. Here is a complete Express example using the current createChallenge and verifySolution APIs from ribaunt.
createChallenge() accepts either positional arguments or an options object. The options object supports difficulty, amount, ttlSeconds, context, and an adaptive workload configuration.verifySolution() now returns a structured result object instead of a bare boolean. Check result.valid and use result.reason or result.message when verification fails.
4

Add the widget to your frontend

Include the Ribaunt web component script and place the <ribaunt-widget> element wherever you need CAPTCHA protection. The widget fetches a challenge from your server, solves it in the browser, and sends the solutions back to your verify endpoint when auto-verify="true" is set.
If you’re using React, import the wrapper component instead of the web component directly. See React Integration for the full example.
The widget emits a verify event when the challenge is solved. A corresponding error event fires if verification fails, and state-change reports intermediate states such as fetching, solving, verifying, and done.

Next steps

Widget configuration

Explore all widget attributes — timeouts, worker mode, challenge method, calibration, theming, 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, structured warnings, and context-aware verification.