Zum Inhalt springen

React Integration

Procaptcha bietet eine offizielle React-Komponente für die einfache Integration von Prosopo Procaptcha in jedes React-Projekt. Die Integrationskomponente unterstützt alle Procaptcha Render-Optionen.

npm install @prosopo/react-procaptcha-wrapper

import {ProcaptchaComponent} from "@prosopo/react-procaptcha-wrapper";
// ...
<ProcaptchaComponent siteKey={"my-site-key"}/>;
// ...
<ProcaptchaComponent
siteKey={siteKey}
language={"en"}
callback={(token: string): void => {
console.log("verified", token);
}}
htmlAttributes={{
className: "my-app__procaptcha",
style: {
maxWidth: "600px",
},
}}
/>