Aller au contenu

Intégration Svelte

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

npm install @prosopo/svelte-procaptcha-wrapper

<script lang="ts">
import {ProcaptchaComponent} from "@prosopo/svelte-procaptcha-wrapper";
</script>
<ProcaptchaComponent siteKey={"my-site-key"}/>;
<script lang="ts">
import {ProcaptchaComponent} from "@prosopo/svelte-procaptcha-wrapper";
const siteKey = "my-site-key";
const handleVerification = (token: string): void => {
console.log('verified', token);
};
</script>
<ProcaptchaComponent siteKey="{siteKey}"
language="en"
callback={handleVerification}
htmlAttributes={{class: "my-app__procaptcha"}} />