@myrasec/eu-captcha 0.0.16 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
This package provides an easy integration of EU CAPTCHA from Myra Security.
|
|
1
|
+
This package provides an easy integration of EU CAPTCHA from Myra Security for React.
|
|
2
2
|
|
|
3
3
|
The package can be used with and without React.
|
|
4
4
|
|
|
@@ -101,6 +101,28 @@ Set `autostart={false}` and assign a `widgetId`, then trigger the challenge manu
|
|
|
101
101
|
/>
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
+
### Next.js
|
|
105
|
+
|
|
106
|
+
**App Router** — components that render `<EuCaptcha>` rely on browser APIs and must be Client Components. Add `'use client'` at the top of the file:
|
|
107
|
+
|
|
108
|
+
```tsx
|
|
109
|
+
'use client';
|
|
110
|
+
|
|
111
|
+
import { EuCaptcha, isEuCaptchaDone } from "@myrasec/eu-captcha";
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Pages Router** — import the component with SSR disabled using `next/dynamic`:
|
|
115
|
+
|
|
116
|
+
```tsx
|
|
117
|
+
import dynamic from "next/dynamic";
|
|
118
|
+
import { isEuCaptchaDone } from "@myrasec/eu-captcha";
|
|
119
|
+
|
|
120
|
+
const EuCaptcha = dynamic(
|
|
121
|
+
() => import("@myrasec/eu-captcha").then((m) => m.EuCaptcha),
|
|
122
|
+
{ ssr: false }
|
|
123
|
+
);
|
|
124
|
+
```
|
|
125
|
+
|
|
104
126
|
## Without React
|
|
105
127
|
|
|
106
128
|
To use the package without React, load the script programmatically.
|
package/package.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myrasec/eu-captcha",
|
|
3
3
|
"private": false,
|
|
4
|
-
"
|
|
4
|
+
"description": "EU CAPTCHA integration for React",
|
|
5
|
+
"license": "BSD-2-Clause",
|
|
6
|
+
"version": "1.0.0",
|
|
5
7
|
"type": "module",
|
|
6
8
|
"main": "./dist/eu-captcha.umd.cjs",
|
|
7
9
|
"module": "./dist/eu-captcha.js",
|