Aller au contenu

Intégration React

Procaptcha fournit un composant React officiel pour une intégration facile de Prosopo Procaptcha dans n’importe quel projet React. Le composant d’intégration prend en charge toutes les options de rendu Procaptcha.

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",
},
}}
/>