altcha 0.6.7 → 0.7.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 CHANGED
@@ -26,6 +26,8 @@ https://altcha.org
26
26
  - [PHP](https://github.com/altcha-org/altcha-lib-php)
27
27
  - [Go](https://github.com/altcha-org/altcha-lib-go)
28
28
  - [Python](https://github.com/altcha-org/altcha-lib-py)
29
+ - [Java](https://github.com/altcha-org/altcha-lib-java)
30
+ - [Ruby](https://github.com/altcha-org/altcha-lib-rb)
29
31
 
30
32
  ## Plugins
31
33
 
@@ -89,7 +91,9 @@ Required options (at least one is required):
89
91
 
90
92
  Additional options:
91
93
 
94
+ - __analytics__ - Enable analytics with [ALTCHA Forms](https://altcha.org/forms/). See [HTML submissions documentation](https://altcha.org/docs/forms/features/html-submissions).
92
95
  - __auto__ - Automatically verify without user interaction (possible values: `onfocus`, `onload`, `onsubmit`).
96
+ - __beaconurl__ - URL to which analytics data will be sent using a beacon POST if the form is abandoned. This option is only used when `analytics` is enabled.
93
97
  - __blockspam__ - Only used in conjunction with the `spamfilter` option. If enabled, it will block form submission and fail verification if the Spam Filter returns a negative classification. This effectively prevents submission of the form.
94
98
  - __delay__ - The artificial delay in milliseconds to apply before the verification (defaults to 0).
95
99
  - __expire__ - The challenge expiration (duration in milliseconds).
@@ -103,7 +107,7 @@ Additional options:
103
107
  - __spamfilter__ - Enable [Spam Filter](#spam-filter).
104
108
  - __strings__ - JSON-encoded translation strings. Refer to [customization](/docs/widget-customization).
105
109
  - __refetchonexpire__ - Automatically re-fetch and re-validate when the challenge expires (defaults to true).
106
- - __verifyurl__ - Enable server-side verification by configuring the URL to use for verification requests. This option can be used in conjunction with `spamfilter` to enable server-side verification.
110
+ - __verifyurl__ - URL for server-side verification requests. This option is automatically configured when the `spamfilter` option is used. Override this setting only if you are using a custom server implementation.
107
111
  - __workers__ - The number of workers to utilize for PoW (defaults to `navigator.hardwareConcurrency || 8`, max. value `16`).
108
112
  - __workerurl__ - The URL of the Worker script (defaults to `./worker.js`, only works with `external` build).
109
113
 
@@ -135,35 +139,41 @@ Available configuration options:
135
139
 
136
140
  ```ts
137
141
  export interface Configure {
138
- auto?: 'onload' | 'onsubmit';
142
+ analytics?: boolean | string;
143
+ auto?: 'onfocus' | 'onload' | 'onsubmit';
144
+ beaconurl?: string;
139
145
  challenge?: {
140
146
  algorithm: string;
141
147
  challenge: string;
148
+ maxnumber?: number;
142
149
  salt: string;
143
150
  signature: string;
144
151
  };
152
+ challengeurl?: string;
145
153
  debug?: boolean;
146
154
  delay?: number;
147
155
  expire?: number;
148
156
  floating?: 'auto' | 'top' | 'bottom';
149
157
  floatinganchor?: string;
150
158
  floatingoffset?: number;
159
+ autorenew?: boolean;
151
160
  hidefooter?: boolean;
152
161
  hidelogo?: boolean;
153
162
  maxnumber?: number;
154
163
  mockerror?: boolean;
155
164
  name?: string;
156
165
  refetchonexpire?: boolean;
157
- spamfilter: boolean | 'ipAddress' | SpamFilter;
166
+ spamfilter?: boolean | 'ipAddress' | SpamFilter;
158
167
  strings?: {
159
- error?: string;
160
- footer?: string;
161
- label?: string;
162
- verified?: string;
163
- verifying?: string;
164
- waitAlert?: string;
165
- };
166
- test?: boolean | number;
168
+ error: string;
169
+ expired: string;
170
+ footer: string;
171
+ label: string;
172
+ verified: string;
173
+ verifying: string;
174
+ waitAlert: string;
175
+ }
176
+ test?: boolean | number | 'delay';
167
177
  verifyurl?: string;
168
178
  workers?: number;
169
179
  workerurl?: string;
@@ -196,7 +206,7 @@ document.querySelector('#altcha').addEventListener('statechange', (ev) => {
196
206
  ```
197
207
 
198
208
  > [!IMPORTANT]
199
- > Both programmatic configuration and event listeners have to called/attached after the ALTCHA script loads, such as within window.addEventListener('load', ...).
209
+ > Both programmatic configuration and event listeners have to called/attached after the ALTCHA script loads, such as within `window.addEventListener('load', ...)`.
200
210
 
201
211
  ## Spam Filter
202
212
 
package/dist/altcha.d.ts CHANGED
@@ -17,7 +17,9 @@ declare global {
17
17
  interface AltchaServerVerificationEvent extends CustomEvent<Record<string, unknown>> {}
18
18
 
19
19
  interface AltchaWidget {
20
+ analytics?: boolean | string;
20
21
  auto?: 'onfocus' | 'onload' | 'onsubmit';
22
+ beaconurl?: string;
21
23
  blockspam?: boolean;
22
24
  challengeurl?: string;
23
25
  challengejson?: string;