altcha 2.0.0-beta.1 → 2.0.0-beta.10
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 +10 -8
- package/dist/altcha.d.ts +5 -1
- package/dist/altcha.js +1476 -1476
- package/dist/altcha.umd.cjs +4 -14
- package/dist_external/altcha.css +1 -253
- package/dist_external/altcha.d.ts +5 -1
- package/dist_external/altcha.js +1345 -1352
- package/dist_external/altcha.umd.cjs +3 -13
- package/dist_i18n/af.js +21 -0
- package/dist_i18n/af.umd.cjs +1 -0
- package/dist_i18n/all.js +197 -133
- package/dist_i18n/all.umd.cjs +1 -1
- package/dist_i18n/americas.js +5 -8
- package/dist_i18n/americas.umd.cjs +1 -1
- package/dist_i18n/ar.js +3 -4
- package/dist_i18n/ar.umd.cjs +1 -1
- package/dist_i18n/asia.js +28 -44
- package/dist_i18n/asia.umd.cjs +1 -1
- package/dist_i18n/bg.js +3 -4
- package/dist_i18n/bg.umd.cjs +1 -1
- package/dist_i18n/bn.js +3 -4
- package/dist_i18n/bn.umd.cjs +1 -1
- package/dist_i18n/bs.js +21 -0
- package/dist_i18n/bs.umd.cjs +1 -0
- package/dist_i18n/ca.js +21 -0
- package/dist_i18n/ca.umd.cjs +1 -0
- package/dist_i18n/cs.js +1 -2
- package/dist_i18n/cs.umd.cjs +1 -1
- package/dist_i18n/da.js +1 -2
- package/dist_i18n/da.umd.cjs +1 -1
- package/dist_i18n/de.js +1 -2
- package/dist_i18n/de.umd.cjs +1 -1
- package/dist_i18n/el.js +1 -2
- package/dist_i18n/el.umd.cjs +1 -1
- package/dist_i18n/en.js +1 -2
- package/dist_i18n/en.umd.cjs +1 -1
- package/dist_i18n/es-419.js +3 -4
- package/dist_i18n/es-419.umd.cjs +1 -1
- package/dist_i18n/es-es.js +1 -2
- package/dist_i18n/es-es.umd.cjs +1 -1
- package/dist_i18n/et.js +3 -4
- package/dist_i18n/et.umd.cjs +1 -1
- package/dist_i18n/eu.js +1 -2
- package/dist_i18n/eu.umd.cjs +1 -1
- package/dist_i18n/europe.js +159 -76
- package/dist_i18n/europe.umd.cjs +1 -1
- package/dist_i18n/fi.js +1 -2
- package/dist_i18n/fi.umd.cjs +1 -1
- package/dist_i18n/fr-ca.js +1 -2
- package/dist_i18n/fr-ca.umd.cjs +1 -1
- package/dist_i18n/fr-fr.js +1 -2
- package/dist_i18n/fr-fr.umd.cjs +1 -1
- package/dist_i18n/ga.js +1 -2
- package/dist_i18n/ga.umd.cjs +1 -1
- package/dist_i18n/he.js +1 -2
- package/dist_i18n/he.umd.cjs +1 -1
- package/dist_i18n/hi.js +3 -4
- package/dist_i18n/hi.umd.cjs +1 -1
- package/dist_i18n/hr.js +1 -2
- package/dist_i18n/hr.umd.cjs +1 -1
- package/dist_i18n/hu.js +3 -4
- package/dist_i18n/hu.umd.cjs +1 -1
- package/dist_i18n/id.js +1 -2
- package/dist_i18n/id.umd.cjs +1 -1
- package/dist_i18n/is.js +21 -0
- package/dist_i18n/is.umd.cjs +1 -0
- package/dist_i18n/it.js +1 -2
- package/dist_i18n/it.umd.cjs +1 -1
- package/dist_i18n/ja.js +3 -4
- package/dist_i18n/ja.umd.cjs +1 -1
- package/dist_i18n/ko.js +3 -4
- package/dist_i18n/ko.umd.cjs +1 -1
- package/dist_i18n/lt.js +1 -2
- package/dist_i18n/lt.umd.cjs +1 -1
- package/dist_i18n/lv.js +1 -2
- package/dist_i18n/lv.umd.cjs +1 -1
- package/dist_i18n/mr.js +3 -4
- package/dist_i18n/mr.umd.cjs +1 -1
- package/dist_i18n/mt.js +1 -2
- package/dist_i18n/mt.umd.cjs +1 -1
- package/dist_i18n/nb.js +22 -0
- package/dist_i18n/nb.umd.cjs +1 -0
- package/dist_i18n/nl.js +1 -2
- package/dist_i18n/nl.umd.cjs +1 -1
- package/dist_i18n/pl.js +3 -4
- package/dist_i18n/pl.umd.cjs +1 -1
- package/dist_i18n/pt-br.js +1 -2
- package/dist_i18n/pt-br.umd.cjs +1 -1
- package/dist_i18n/pt-pt.js +3 -4
- package/dist_i18n/pt-pt.umd.cjs +1 -1
- package/dist_i18n/ro.js +1 -2
- package/dist_i18n/ro.umd.cjs +1 -1
- package/dist_i18n/ru.js +3 -4
- package/dist_i18n/ru.umd.cjs +1 -1
- package/dist_i18n/sk.js +3 -4
- package/dist_i18n/sk.umd.cjs +1 -1
- package/dist_i18n/sl.js +1 -2
- package/dist_i18n/sl.umd.cjs +1 -1
- package/dist_i18n/sr.js +21 -0
- package/dist_i18n/sr.umd.cjs +1 -0
- package/dist_i18n/sv.js +1 -2
- package/dist_i18n/sv.umd.cjs +1 -1
- package/dist_i18n/ta.js +3 -4
- package/dist_i18n/ta.umd.cjs +1 -1
- package/dist_i18n/te.js +1 -2
- package/dist_i18n/te.umd.cjs +1 -1
- package/dist_i18n/th.js +3 -4
- package/dist_i18n/th.umd.cjs +1 -1
- package/dist_i18n/tr.js +1 -2
- package/dist_i18n/tr.umd.cjs +1 -1
- package/dist_i18n/uk.js +3 -4
- package/dist_i18n/uk.umd.cjs +1 -1
- package/dist_i18n/ur.js +3 -4
- package/dist_i18n/ur.umd.cjs +1 -1
- package/dist_i18n/vi.js +3 -4
- package/dist_i18n/vi.umd.cjs +1 -1
- package/dist_i18n/zh-cn.js +3 -4
- package/dist_i18n/zh-cn.umd.cjs +1 -1
- package/dist_i18n/zh-tw.js +3 -4
- package/dist_i18n/zh-tw.umd.cjs +1 -1
- package/dist_plugins/upload.js +145 -133
- package/dist_plugins/upload.umd.cjs +4 -4
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ ALTCHA is a self-hosted, privacy-first security solution that protects your webs
|
|
|
4
4
|
|
|
5
5
|
ALTCHA is fully compliant with:
|
|
6
6
|
|
|
7
|
-
- **Global privacy regulations**: GDPR, HIPAA, CCPA, LGPD, and PIPL
|
|
7
|
+
- **Global privacy regulations**: GDPR, HIPAA, CCPA, PIPEDA/CPPA, LGPD, and PIPL
|
|
8
8
|
- **Accessibility standards**: [WCAG 2.2 AA-level](https://altcha.org/docs/wcag/) and the [European Accessibility Act](https://altcha.org/docs/european-accessibility-act-2025/)
|
|
9
9
|
|
|
10
10
|
For more details, visit [altcha.org](https://altcha.org).
|
|
@@ -20,11 +20,11 @@ For more details, visit [altcha.org](https://altcha.org).
|
|
|
20
20
|
|
|
21
21
|
## What’s New in v2
|
|
22
22
|
|
|
23
|
-
Version 2 introduces enhanced accessibility, expanded language support
|
|
23
|
+
Version 2 introduces enhanced accessibility, expanded language support, and integration with **ALTCHA Sentinel**—a self-hosted anti-spam solution for websites, apps, and services.
|
|
24
24
|
|
|
25
25
|
### Key Improvements in v2
|
|
26
26
|
|
|
27
|
-
- **Built-in Internationalization (i18n)** for
|
|
27
|
+
- **Built-in Internationalization (i18n)** for 48+ languages
|
|
28
28
|
- **Improved RTL (right-to-left) language support**
|
|
29
29
|
- **Enhanced WCAG accessibility**
|
|
30
30
|
- **Support for accessible code challenges** (image + audio options)
|
|
@@ -117,11 +117,11 @@ ALTCHA is optimized for performance:
|
|
|
117
117
|
|
|
118
118
|
| Distribution | Size (GZIPped) |
|
|
119
119
|
|-------------------|----------------|
|
|
120
|
-
| ALTCHA (v2.x) |
|
|
120
|
+
| ALTCHA (v2.x) | 28+ kB |
|
|
121
121
|
| hCaptcha | 48+ kB |
|
|
122
122
|
| reCAPTCHA | 270+ kB |
|
|
123
123
|
|
|
124
|
-
When GZIPped, it totals about
|
|
124
|
+
When GZIPped, it totals about 28 kB, making ALTCHA’s widget about 90% smaller than reCAPTCHA.
|
|
125
125
|
|
|
126
126
|
## Content Security Policy (CSP)
|
|
127
127
|
|
|
@@ -141,6 +141,7 @@ Additional options:
|
|
|
141
141
|
- **customfetch**: A custom `fetch` function for retrieving the challenge.
|
|
142
142
|
Accepts `url: string` and `init: RequestInit` as arguments and must return a [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response).
|
|
143
143
|
- **delay**: Artificial delay in milliseconds before verification (defaults to 0).
|
|
144
|
+
- **disableautofocus**: If true, prevents the code-challenge input from automatically receiving focus on render (defaults to `false`).
|
|
144
145
|
- **expire**: Challenge expiration duration in milliseconds.
|
|
145
146
|
- **floating**: Enable floating UI (possible values: `auto`, `top`, `bottom`).
|
|
146
147
|
- **floatinganchor**: CSS selector of the "anchor" to which the floating UI will be attached (defaults to the `button[type="submit"]` in the related form).
|
|
@@ -169,14 +170,14 @@ Development / Testing options:
|
|
|
169
170
|
|
|
170
171
|
## Internationalization (i18n)
|
|
171
172
|
|
|
172
|
-
ALTCHA supports **
|
|
173
|
+
ALTCHA supports **48+ languages**. Import translations from `altcha/i18n/*`:
|
|
173
174
|
|
|
174
175
|
```js
|
|
175
176
|
import 'altcha';
|
|
176
177
|
import 'altcha/i18n/all'; // All languages
|
|
177
178
|
// Or import specific languages:
|
|
178
179
|
import 'altcha/i18n/de';
|
|
179
|
-
import 'altcha/i18n/fr';
|
|
180
|
+
import 'altcha/i18n/fr-fr';
|
|
180
181
|
```
|
|
181
182
|
|
|
182
183
|
The widget auto-detects language from `<html lang="...">` or `navigator.languages`. Override with the `language` attribute:
|
|
@@ -208,7 +209,7 @@ Enable plugins per widget:
|
|
|
208
209
|
### Available Plugins
|
|
209
210
|
|
|
210
211
|
- **obfuscation**: Secure sensitive data (emails, phone numbers).
|
|
211
|
-
- **upload**: File uploads.
|
|
212
|
+
- **upload**: File uploads with ALTCHA Sentinel or a custom backend.
|
|
212
213
|
|
|
213
214
|
## Programmatic Configuration
|
|
214
215
|
|
|
@@ -250,6 +251,7 @@ export interface Configure {
|
|
|
250
251
|
customfetch?: string | ((url: string, init?: RequestInit) => Promise<Response>);
|
|
251
252
|
debug?: boolean;
|
|
252
253
|
delay?: number;
|
|
254
|
+
disableautofocus?: boolean;
|
|
253
255
|
expire?: number;
|
|
254
256
|
floating?: 'auto' | 'top' | 'bottom';
|
|
255
257
|
floatinganchor?: string;
|
package/dist/altcha.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ declare module 'altcha';
|
|
|
5
5
|
declare global {
|
|
6
6
|
var altchaCreateWorker: (url?: string) => Worker;
|
|
7
7
|
var altchaPlugins: any[];
|
|
8
|
-
var altchaI18n: Record<string, any
|
|
8
|
+
var altchaI18n: Record<string, any> & {
|
|
9
|
+
register: (language: string, translation: Record<string, string>) => void;
|
|
10
|
+
};
|
|
9
11
|
|
|
10
12
|
type AltchaState = 'error' | 'expired' | 'verified' | 'verifying' | 'unverified';
|
|
11
13
|
|
|
@@ -22,6 +24,7 @@ declare global {
|
|
|
22
24
|
|
|
23
25
|
interface AltchaWidgetOptions {
|
|
24
26
|
auto?: 'off' | 'onfocus' | 'onload' | 'onsubmit';
|
|
27
|
+
/** @deprecated */
|
|
25
28
|
blockspam?: boolean;
|
|
26
29
|
challengeurl?: string;
|
|
27
30
|
challengejson?: string;
|
|
@@ -29,6 +32,7 @@ declare global {
|
|
|
29
32
|
customfetch?: string | ((url: string, init?: RequestInit) => Promise<Response>);
|
|
30
33
|
debug?: boolean;
|
|
31
34
|
delay?: number;
|
|
35
|
+
disableautofocus?: boolean;
|
|
32
36
|
expire?: number;
|
|
33
37
|
floating?: 'auto' | 'top' | 'bottom' | 'false' | '' | boolean;
|
|
34
38
|
floatinganchor?: string;
|