turnstile-svelte Svelte Themes

Turnstile Svelte

Simple and declarative Cloudflare Turnstile integration for Svelte & SvelteKit.

turnstile-svelte

A lightweight and declarative Cloudflare Turnstile integration for Svelte and SvelteKit.

Live playground: battlefieldduck.github.io/turnstile-svelte

Installation

npm install @battlefieldduck/turnstile-svelte

Example

<script lang="ts">
    import { turnstile } from '@battlefieldduck/turnstile-svelte';

    function callback(token: string) {
        console.log('Challenge Success:', token);
    }
</script>

<div {@attach turnstile({ sitekey: '1x00000000000000000000AA', callback })}></div>

Docs

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues.

License

turnstile-svelte is licensed under the MIT License. See the LICENSE file for more details.

Stargazers over time

Top categories

Loading Svelte Themes