@prosopo/client-bundle-example 0.2.16 → 0.2.19
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 +1 -1
- package/package.json +10 -4
- package/src/index.html +0 -47
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Getting Started with the Client Bundle Example
|
|
2
2
|
|
|
3
|
-
This project is a
|
|
3
|
+
This project is a _minimal_ example demonstrating how to include the Prosopo Procaptcha bundle in a client app.
|
|
4
4
|
|
|
5
5
|
## How to run locally
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -2,18 +2,24 @@
|
|
|
2
2
|
"name": "@prosopo/client-bundle-example",
|
|
3
3
|
"main": "index.js",
|
|
4
4
|
"engines": {
|
|
5
|
-
"node": ">=
|
|
6
|
-
"npm": "
|
|
5
|
+
"node": ">=18",
|
|
6
|
+
"npm": ">=9"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
9
|
"start": "light-server -s ./src -p 9232 -w \"**/*.html,**/*.css,**/*.js,**/*.gz\"",
|
|
10
|
-
"clean": "echo 'nothing to clean'"
|
|
10
|
+
"clean": "echo 'nothing to clean'",
|
|
11
|
+
"eslint": "npx eslint . --no-error-on-unmatched-pattern --ignore-path ../../.eslintignore",
|
|
12
|
+
"eslint:fix": "npm run eslint -- --fix",
|
|
13
|
+
"prettier": "npx prettier . --check --no-error-on-unmatched-pattern --ignore-path ../../.eslintignore",
|
|
14
|
+
"prettier:fix": "npm run prettier -- --write",
|
|
15
|
+
"lint": "npm run eslint && npm run prettier",
|
|
16
|
+
"lint:fix": "npm run eslint:fix && npm run prettier:fix"
|
|
11
17
|
},
|
|
12
18
|
"dependencies": {
|
|
13
19
|
"dotenv": "^16.0.1",
|
|
14
20
|
"light-server": "^2.9.1"
|
|
15
21
|
},
|
|
16
|
-
"version": "0.2.
|
|
22
|
+
"version": "0.2.19",
|
|
17
23
|
"devDependencies": {
|
|
18
24
|
"tslib": "2.6.2",
|
|
19
25
|
"typescript": "5.1.6"
|
package/src/index.html
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
<html>
|
|
2
|
-
<head>
|
|
3
|
-
<link href="//cdn.muicss.com/mui-0.10.3/css/mui.min.css" rel="stylesheet" type="text/css"/>
|
|
4
|
-
<title>Procaptcha demo: Simple page</title>
|
|
5
|
-
<script id="procaptchaScript" src="procaptcha.bundle.js" async defer></script>
|
|
6
|
-
</head>
|
|
7
|
-
<body>
|
|
8
|
-
<div class="mui-container">
|
|
9
|
-
<form action="?" class="mui-form">
|
|
10
|
-
<legend>Login</legend>
|
|
11
|
-
<div class="mui-textfield mui-textfield--float-label">
|
|
12
|
-
<label>Email Address</label>
|
|
13
|
-
<input type="email" required/>
|
|
14
|
-
</div>
|
|
15
|
-
<div class="mui-textfield mui-textfield--float-label">
|
|
16
|
-
<label>Password</label>
|
|
17
|
-
<input type="password" required/>
|
|
18
|
-
</div>
|
|
19
|
-
<div id="procaptcha-container"></div>
|
|
20
|
-
<!-- Dev sitekey -->
|
|
21
|
-
<div
|
|
22
|
-
class="procaptcha"
|
|
23
|
-
data-theme="light"
|
|
24
|
-
data-sitekey="5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw"
|
|
25
|
-
></div>
|
|
26
|
-
<input type="submit" class="mui-btn mui-btn--raised"/>
|
|
27
|
-
</form>
|
|
28
|
-
</div>
|
|
29
|
-
<script>
|
|
30
|
-
// A function that will call the render Procaptcha function when the procaptcha script has loaded
|
|
31
|
-
document.getElementById('procaptchaScript').addEventListener('load', function () {
|
|
32
|
-
|
|
33
|
-
// Define a callback function to be called when the CAPTCHA is verified
|
|
34
|
-
window.onCaptchaVerified = function (output) {
|
|
35
|
-
console.log('Captcha verified, output: ' + JSON.stringify(output))
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Render the CAPTCHA explicitly on a container with id "procaptcha-container"
|
|
39
|
-
window.procaptcha.render('procaptcha-container', {
|
|
40
|
-
siteKey: '5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw',
|
|
41
|
-
theme: 'dark',
|
|
42
|
-
callback: 'onCaptchaVerified',
|
|
43
|
-
})
|
|
44
|
-
})
|
|
45
|
-
</script>
|
|
46
|
-
</body>
|
|
47
|
-
</html>
|