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.
1. Installation
Titre de la section 1. Installationnpm install @prosopo/react-procaptcha-wrapper
2. Exemple d’utilisation
Titre de la section 2. Exemple d’utilisation2.1) Configuration de base
Titre de la section 2.1) Configuration de baseimport {ProcaptchaComponent} from "@prosopo/react-procaptcha-wrapper";
// ...
<ProcaptchaComponent siteKey={"my-site-key"}/>;2.2) Utilisation avancée
Titre de la section 2.2) Utilisation avancée// ...
<ProcaptchaComponent siteKey={siteKey} language={"en"} callback={(token: string): void => { console.log("verified", token); }} htmlAttributes={{ className: "my-app__procaptcha", style: { maxWidth: "600px", }, }}/>