Svelte Integration
Procaptcha provides an official Svelte component for easy integration of Prosopo Procaptcha into any Svelte project. The integration component supports all the Procaptcha render options.
1. Installation
Section titled 1. Installationnpm install @prosopo/svelte-procaptcha-wrapper
2. Example of usage
Section titled 2. Example of usage2.1) Basic setup
Section titled 2.1) Basic setup<script lang="ts">import {ProcaptchaComponent} from "@prosopo/svelte-procaptcha-wrapper";</script>
<ProcaptchaComponent siteKey={"my-site-key"}/>;
2.2) Advanced usage
Section titled 2.2) Advanced usage<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"}} />