@@ -20,23 +20,23 @@ https://react-turnstile.vercel.app/
20
20
21
21
## Install
22
22
1 . First, [ follow these steps] ( https://developers.cloudflare.com/turnstile/get-started/ ) to obtain a free site key and secret key from Cloudflare.
23
- 2 . Install ` react. turnstile ` into your React application.
23
+ 2 . Install ` @marsidev/ react- turnstile` into your React application.
24
24
25
25
```bash
26
26
# Whichever matches your package manager
27
- pnpm add react. turnstile
28
- npm install react. turnstile
29
- yarn add react. turnstile
27
+ pnpm add @marsidev/ react- turnstile
28
+ npm install @marsidev/ react- turnstile
29
+ yarn add @marsidev/ react- turnstile
30
30
```
31
31
32
32
## Usage
33
33
34
34
The only required prop is the ` siteKey ` .
35
35
36
36
``` jsx
37
- import { Turnstile } from ' react. turnstile'
37
+ import { Turnstile } from ' @marsidev/ react- turnstile'
38
38
39
- function TurnstileWidget () {
39
+ function Widget () {
40
40
return < Turnstile siteKey= ' 1x00000000000000000000AA' / >
41
41
}
42
42
```
@@ -81,18 +81,18 @@ function TurnstileWidget() {
81
81
82
82
### Rendering the widget:
83
83
``` jsx
84
- import { Turnstile } from ' react. turnstile'
84
+ import { Turnstile } from ' @marsidev/ react- turnstile'
85
85
86
- function TurnstileWidget () {
86
+ function Widget () {
87
87
return < Turnstile siteKey= ' 1x00000000000000000000AA' / >
88
88
}
89
89
```
90
90
91
91
### Rendering the widget with custom props:
92
92
``` jsx
93
- import { Turnstile } from ' react. turnstile'
93
+ import { Turnstile } from ' @marsidev/ react- turnstile'
94
94
95
- function TurnstileWidget () {
95
+ function Widget () {
96
96
return (
97
97
< Turnstile
98
98
siteKey= ' 1x00000000000000000000AA'
@@ -112,9 +112,9 @@ function TurnstileWidget() {
112
112
### Managing widget rendering status:
113
113
``` jsx
114
114
import { useState } from ' react'
115
- import { Turnstile } from ' react. turnstile'
115
+ import { Turnstile } from ' @marsidev/ react- turnstile'
116
116
117
- function TurnstileWidget () {
117
+ function Widget () {
118
118
const [status , setStatus ] = useState ()
119
119
120
120
return (
@@ -131,9 +131,9 @@ function TurnstileWidget() {
131
131
### Getting the token after solving the challenge:
132
132
``` jsx
133
133
import { useState } from ' react'
134
- import { Turnstile } from ' react. turnstile'
134
+ import { Turnstile } from ' @marsidev/ react- turnstile'
135
135
136
- function TurnstileWidget () {
136
+ function Widget () {
137
137
const [token , setToken ] = useState ()
138
138
139
139
return (
@@ -148,9 +148,9 @@ function TurnstileWidget() {
148
148
### Interacting with the widget:
149
149
``` jsx
150
150
import { useRef } from ' react'
151
- import { Turnstile } from ' react. turnstile'
151
+ import { Turnstile } from ' @marsidev/ react- turnstile'
152
152
153
- function TurnstileWidget () {
153
+ function Widget () {
154
154
const ref = useRef (null )
155
155
156
156
return (
@@ -180,9 +180,9 @@ function TurnstileWidget() {
180
180
### Interacting with the widget (using TypeScript):
181
181
` ` ` jsx
182
182
import { useRef } from ' react'
183
- import { Turnstile , type TurnstileInstance } from ' react. turnstile'
183
+ import { Turnstile , type TurnstileInstance } from ' @marsidev/ react- turnstile'
184
184
185
- function TurnstileWidget () {
185
+ function Widget () {
186
186
const ref = useRef< TurnstileInstance> (null )
187
187
188
188
return (
@@ -201,7 +201,7 @@ function TurnstileWidget() {
201
201
` ` ` jsx
202
202
// LoginForm.jsx
203
203
import { useRef , useState } from ' react'
204
- import { Turnstile } from ' react. turnstile'
204
+ import { Turnstile } from ' @marsidev/ react- turnstile'
205
205
206
206
export default function LoginForm () {
207
207
const formRef = useRef (null )
@@ -295,15 +295,15 @@ Published under the [MIT License](./LICENCE).
295
295
296
296
<!-- Badges -->
297
297
298
- [npm-version-src]: https://badgen.net/npm/v/react. turnstile?style=flat-square
299
- [npm-version-href]: https://npm.im/react. turnstile
300
- [npm-downloads-src]: https://badgen.net/npm/dm/react. turnstile?style=flat-square
301
- [npm-downloads-href]: https://npm.im/react. turnstile
298
+ [npm-version-src]: https://badgen.net/npm/v/@marsidev/ react- turnstile?style=flat-square
299
+ [npm-version-href]: https://npm.im/@marsidev/ react- turnstile
300
+ [npm-downloads-src]: https://badgen.net/npm/dm/@marsidev/ react- turnstile?style=flat-square
301
+ [npm-downloads-href]: https://npm.im/@marsidev/ react- turnstile
302
302
<!-- [github-actions-src]: https://img.shields.io/github/workflow/status/danielroe/nuxt-turnstile/ci/main?style=flat-square -->
303
303
<!-- [github-actions-href]: https://github.com/danielroe/nuxt-turnstile/actions?query=workflow%3Aci -->
304
304
<!-- [codecov-src]: https://img.shields.io/codecov/c/gh/danielroe/nuxt-turnstile/main?style=flat-square -->
305
305
<!-- [codecov-href]: https://codecov.io/gh/danielroe/nuxt-turnstile -->
306
- [packagephobia-src]: https://packagephobia.com/badge?p=react. turnstile
307
- [packagephobia-href]: https://packagephobia.com/result?p=react. turnstile
306
+ [packagephobia-src]: https://packagephobia.com/badge?p=@marsidev/ react- turnstile
307
+ [packagephobia-href]: https://packagephobia.com/result?p=@marsidev/ react- turnstile
308
308
[prs-src]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
309
309
[tests-src]: https://img.shields.io/badge/Tests-missing-red.svg?style=flat-square
0 commit comments