Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Add 'packages/captcha/' from commit '959588de2157ba60bda7624b0315b5071711f6c9'

Blue Mouse83adf9f9e68d
diff --cc packages/captcha/.gitignore
index 000000000,000000000..df486907f
new file mode 100644
--- /dev/null
+++ b/packages/captcha/.gitignore
@@@ -1,0 -1,0 +1,109 @@@
++# Logs
++logs
++*.log
++npm-debug.log*
++yarn-debug.log*
++yarn-error.log*
++lerna-debug.log*
++
++# Diagnostic reports (https://nodejs.org/api/report.html)
++report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
++
++# Runtime data
++pids
++*.pid
++*.seed
++*.pid.lock
++
++# Directory for instrumented libs generated by jscoverage/JSCover
++lib-cov
++
++# Coverage directory used by tools like istanbul
++coverage
++*.lcov
++
++# nyc test coverage
++.nyc_output
++
++# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
++.grunt
++
++# Bower dependency directory (https://bower.io/)
++bower_components
++
++# node-waf configuration
++.lock-wscript
++
++# Compiled binary addons (https://nodejs.org/api/addons.html)
++build/Release
++
++# Dependency directories
++node_modules/
++jspm_packages/
++
++# TypeScript v1 declaration files
++typings/
++
++# TypeScript cache
++*.tsbuildinfo
++
++# Optional npm cache directory
++.npm
++
++# Optional eslint cache
++.eslintcache
++
++# Microbundle cache
++.rpt2_cache/
++.rts2_cache_cjs/
++.rts2_cache_es/
++.rts2_cache_umd/
++
++# Optional REPL history
++.node_repl_history
++
++# Output of 'npm pack'
++*.tgz
++
++# Yarn Integrity file
++.yarn-integrity
++
++# dotenv environment variables file
++.env
++.env.test
++
++# parcel-bundler cache (https://parceljs.org/)
++.cache
++
++# Next.js build output
++.next
++
++# Nuxt.js build / generate output
++.nuxt
++# dist
++
++# Gatsby files
++.cache/
++# Comment in the public line in if your project uses Gatsby and *not* Next.js
++# https://nextjs.org/blog/next-9-1#public-directory-support
++# public
++
++# vuepress build output
++.vuepress/dist
++
++# Serverless directories
++.serverless/
++
++# FuseBox cache
++.fusebox/
++
++# DynamoDB Local files
++.dynamodb/
++
++# TernJS port file
++.tern-port
++package-lock.json
++
++.DS_Store
++pnpm-lock.yaml
++yarn.lock
diff --cc packages/captcha/.nvmrc
index 000000000,5692975bc..5692975bc
mode 000000,100644..100644
--- a/packages/captcha/.nvmrc
+++ b/packages/captcha/.nvmrc
diff --cc packages/captcha/.prettierrc.cjs
index 000000000,bd6302ddd..bd6302ddd
mode 000000,100644..100644
--- a/packages/captcha/.prettierrc.cjs
+++ b/packages/captcha/.prettierrc.cjs
diff --cc packages/captcha/LICENSE
index 000000000,000000000..70231b647
new file mode 100644
--- /dev/null
+++ b/packages/captcha/LICENSE
@@@ -1,0 -1,0 +1,21 @@@
++MIT License
++
++Copyright (c) 2023 Swetrix
++
++Permission is hereby granted, free of charge, to any person obtaining a copy
++of this software and associated documentation files (the "Software"), to deal
++in the Software without restriction, including without limitation the rights
++to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
++copies of the Software, and to permit persons to whom the Software is
++furnished to do so, subject to the following conditions:
++
++The above copyright notice and this permission notice shall be included in all
++copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
++SOFTWARE.
diff --cc packages/captcha/README.md
index 000000000,000000000..73cfee773
new file mode 100644
--- /dev/null
+++ b/packages/captcha/README.md
@@@ -1,0 -1,0 +1,71 @@@
++<img src="/src/assets/logo_blue.png" alt="" height="80" />
++
++## Description
++
++Swetrix CAPTCHA is a privacy-oriented, simple and opensource CAPTCHA service.
++
++See the full documentation at https://docs.swetrix.com/captcha/introduction
++
++## Features
++
++- **Privacy-focused**: No tracking, no cookies
++- **Accessible**: Full keyboard navigation, ARIA support, screen reader announcements, respects `prefers-reduced-motion`
++- **Progress indicator**: Visual progress bar during verification
++- **Auto theme detection**: Automatically matches browser's light/dark mode preference
++- **Lightweight**: Minimal footprint, fast loading
++
++## Usage
++
++```html
++<div class="swecaptcha"
++ data-project-id="YOUR_PROJECT_ID"
++ data-theme="auto">
++</div>
++<script src="https://cdn.swetrixcaptcha.com/captcha-loader.js" defer></script>
++```
++
++### Options
++
++| Attribute | Description | Values | Default |
++|-----------|-------------|--------|---------|
++| `data-project-id` | Your project ID | Valid project ID | Required |
++| `data-theme` | Color theme | `auto`, `light`, `dark` | `auto` |
++| `data-response-input-name` | Hidden input name | Any string | `swetrix-captcha-response` |
++| `data-lang` | Force a specific language | `en`, `de`, `fr`, `pl`, `uk` | Auto-detected |
++
++### Language Support
++
++The widget supports **English**, **German**, **French**, **Polish**, and **Ukrainian**.
++
++Language is detected automatically in this order:
++1. `data-lang` attribute on the widget element
++2. `lang` attribute on parent elements (e.g., `<html lang="de">`)
++3. Browser's preferred language
++
++### Theme Options
++
++- `auto`: Automatically detects user's browser theme preference using `prefers-color-scheme`
++- `light`: Forces light theme
++- `dark`: Forces dark theme
++
++## Development
++
++To build the captcha run:
++```bash
++npm run build
++```
++
++After you build it, a new folder `dist` will appear. You can run `test.html` file via an extension like `Live server` to test it (don't forget to set up a valid project ID or one of our [dummy project IDs](https://docs.swetrix.com/captcha/testing)).
++
++## License
++
++Swetrix CAPTCHA client is released under the MIT licence, see [LICENSE](LICENSE).
++
++## Bugs and security
++
++Swetrix is open to pull-requests. Feel free to propose new features or submit bug requests via pull reuqests.\
++For severe security issues, please contact us at [email protected]
++
++## Contact
++
++You can contact us via email at [email protected]
diff --cc packages/captcha/dist/assets/logo_blue.png
index 000000000,f016f5fc6..f016f5fc6
mode 000000,100644..100644
Binary files differ
diff --cc packages/captcha/dist/assets/logo_white.png
index 000000000,122a07b4f..122a07b4f
mode 000000,100644..100644
Binary files differ
diff --cc packages/captcha/dist/captcha-loader.js
index 000000000,faec01f9e..faec01f9e
mode 000000,100644..100644
--- a/packages/captcha/dist/captcha-loader.js
+++ b/packages/captcha/dist/captcha-loader.js
diff --cc packages/captcha/dist/captcha-loader.js.map
index 000000000,dd975fcb6..dd975fcb6
mode 000000,100644..100644
--- a/packages/captcha/dist/captcha-loader.js.map
+++ b/packages/captcha/dist/captcha-loader.js.map
diff --cc packages/captcha/dist/captcha.js
index 000000000,93d8ad2f7..93d8ad2f7
mode 000000,100644..100644
--- a/packages/captcha/dist/captcha.js
+++ b/packages/captcha/dist/captcha.js
diff --cc packages/captcha/dist/captcha.js.map
index 000000000,e6fc2e81a..e6fc2e81a
mode 000000,100644..100644
--- a/packages/captcha/dist/captcha.js.map
+++ b/packages/captcha/dist/captcha.js.map
diff --cc packages/captcha/dist/pages/dark.html
index 000000000,c6b38f0ec..c6b38f0ec
mode 000000,100644..100644
--- a/packages/captcha/dist/pages/dark.html
+++ b/packages/captcha/dist/pages/dark.html
diff --cc packages/captcha/dist/pages/light.html
index 000000000,03892bb90..03892bb90
mode 000000,100644..100644
--- a/packages/captcha/dist/pages/light.html
+++ b/packages/captcha/dist/pages/light.html
diff --cc packages/captcha/dist/pages/test.html
index 000000000,dfda553bd..dfda553bd
mode 000000,100644..100644
--- a/packages/captcha/dist/pages/test.html
+++ b/packages/captcha/dist/pages/test.html
diff --cc packages/captcha/dist/pow-worker.js
index 000000000,148ea0ef1..148ea0ef1
mode 000000,100644..100644
--- a/packages/captcha/dist/pow-worker.js
+++ b/packages/captcha/dist/pow-worker.js
diff --cc packages/captcha/dist/pow-worker.js.map
index 000000000,ea5b705b9..ea5b705b9
mode 000000,100644..100644
--- a/packages/captcha/dist/pow-worker.js.map
+++ b/packages/captcha/dist/pow-worker.js.map
diff --cc packages/captcha/package.json
index 000000000,3c51b3238..3c51b3238
mode 000000,100644..100644
--- a/packages/captcha/package.json
+++ b/packages/captcha/package.json
diff --cc packages/captcha/rollup.config.mjs
index 000000000,a0892e6b6..a0892e6b6
mode 000000,100644..100644
--- a/packages/captcha/rollup.config.mjs
+++ b/packages/captcha/rollup.config.mjs
diff --cc packages/captcha/src/assets/logo_blue.png
index 000000000,000000000..f016f5fc6
new file mode 100644
Binary files differ
diff --cc packages/captcha/src/assets/logo_white.png
index 000000000,000000000..122a07b4f
new file mode 100644
Binary files differ
diff --cc packages/captcha/src/captcha-loader.ts
index 000000000,485220cc8..485220cc8
mode 000000,100644..100644
--- a/packages/captcha/src/captcha-loader.ts
+++ b/packages/captcha/src/captcha-loader.ts
diff --cc packages/captcha/src/captcha.ts
index 000000000,2de986acb..2de986acb
mode 000000,100644..100644
--- a/packages/captcha/src/captcha.ts
+++ b/packages/captcha/src/captcha.ts
diff --cc packages/captcha/src/i18n.ts
index 000000000,b2da5dee4..b2da5dee4
mode 000000,100644..100644
--- a/packages/captcha/src/i18n.ts
+++ b/packages/captcha/src/i18n.ts
diff --cc packages/captcha/src/logger.ts
index 000000000,a230bf1ca..a230bf1ca
mode 000000,100644..100644
--- a/packages/captcha/src/logger.ts
+++ b/packages/captcha/src/logger.ts
diff --cc packages/captcha/src/pages/dark.html
index 000000000,c6b38f0ec..c6b38f0ec
mode 000000,100644..100644
--- a/packages/captcha/src/pages/dark.html
+++ b/packages/captcha/src/pages/dark.html
diff --cc packages/captcha/src/pages/light.html
index 000000000,03892bb90..03892bb90
mode 000000,100644..100644
--- a/packages/captcha/src/pages/light.html
+++ b/packages/captcha/src/pages/light.html
diff --cc packages/captcha/src/pages/test.html
index 000000000,dfda553bd..dfda553bd
mode 000000,100644..100644
--- a/packages/captcha/src/pages/test.html
+++ b/packages/captcha/src/pages/test.html
diff --cc packages/captcha/src/pow-worker.ts
index 000000000,8a2ded452..8a2ded452
mode 000000,100644..100644
--- a/packages/captcha/src/pow-worker.ts
+++ b/packages/captcha/src/pow-worker.ts
diff --cc packages/captcha/tsconfig.esnext.json
index 000000000,08290bee7..08290bee7
mode 000000,100644..100644
--- a/packages/captcha/tsconfig.esnext.json
+++ b/packages/captcha/tsconfig.esnext.json
diff --cc packages/captcha/tsconfig.json
index 000000000,0892225fc..0892225fc
mode 000000,100644..100644
--- a/packages/captcha/tsconfig.json
+++ b/packages/captcha/tsconfig.json