Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

solid-turnstile

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solid-turnstile

🔐 A very simple Solid library for Cloudflare Turnstile. Inspired by react-turnstile

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

solid-turnstile

solid-turnstile

🔐 A very simple Solid library for Cloudflare Turnstile. Inspired by react-turnstile

release npm npm license sponsor

Installation

pnpm add solid-turnstile

Demo

https://xhofe.github.io/solid-turnstile/

Usage

import Turnstile from "react-turnstile";

function TurnstileWidget() {
  return (
    <Turnstile
      sitekey="1x00000000000000000000AA"
      onVerify={(token) => alert(token)}
    />
  );
}

Documentation

Turnstile takes the following arguments:

nametypedescription
sitekeystringsitekey of your website (REQUIRED)
actionstring-
cDatastring-
themestringone of "light", "dark", "auto"
tabIndexnumber-
responseFieldbooleancontrols generation of <input /> element *
responseFieldNamestringchanges the name of <input /> element *

Add others props to <div /> element.

And the following callbacks:

nameargumentsdescription
onVerifytokencalled when challenge is passed (REQUIRED)
onLoad-called when the widget is loaded
onErrorerrorcalled when an error occurs
onExpire-called when the challenge expires **

* responseField and responseFieldName are experimental and not yet documented.

** onExpire is called when the Turnstile challenge expires without creating a token.

For more details on what each argument does, see the Cloudflare Documentation.

Keywords

solidjs

FAQs

Package last updated on 19 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts