Skip to content

Commit

Permalink
0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ovx committed Aug 9, 2024
1 parent 9158c59 commit bddbad5
Show file tree
Hide file tree
Showing 17 changed files with 2,054 additions and 1,327 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

ALTCHA uses a proof-of-work mechanism to protect your website, APIs, and online services from spam and abuse. Unlike other solutions, ALTCHA is self-hosted, does not use cookies nor fingerprinting, does not track users, and is fully compliant with GDPR.

https://altcha.org
Visit [ALTCHA](https://altcha.org) for more information.

## Benefits
## Features

- __Friction-less__ - Using PoW instead of visual puzzles.
- __Cookie-less__ - GDPR compliant by design.
- __Self-hosted__ - Without reliance on external providers in self-hosted mode.
- __SaaS available__ - Visit [altcha.org](https://altcha.org/docs/api) to get started with the SaaS API.
- **Frictionless CAPTCHA Alternative** - Employs proof-of-work (PoW) instead of visual puzzles.
- **Data Obfuscation** - Safeguards your email address from scraping.
- **Cookie-less** - Designed to be GDPR compliant by default.
- **Self-hosted** - Operates independently without relying on external providers.
- **SaaS Available** - Get started with the SaaS API at [altcha.org/docs/api](https://altcha.org/docs/api).

## Examples

Expand Down Expand Up @@ -105,8 +106,9 @@ Additional options:
- __hidelogo__ - Hide the ALTCHA logo.
- __maxnumber__ - The max. number to iterate to (defaults to 1,000,000).
- __name__ - The name of the hidden field containing the payload (defaults to "altcha").
- __obfuscated__ - The [obfuscated data](https://altcha.org/docs/obfuscation) provided as a base64-encoded string. Use only without `challengeurl`/`challengejson`.
- __spamfilter__ - Enable [Spam Filter](#spam-filter).
- __strings__ - JSON-encoded translation strings. Refer to [customization](/docs/widget-customization).
- __strings__ - JSON-encoded translation strings. Refer to [customization](https://altcha.org/docs/widget-customization).
- __refetchonexpire__ - Automatically re-fetch and re-validate when the challenge expires (defaults to true).
- __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.
- __workers__ - The number of workers to utilize for PoW (defaults to `navigator.hardwareConcurrency || 8`, max. value `16`).
Expand Down Expand Up @@ -163,6 +165,7 @@ export interface Configure {
maxnumber?: number;
mockerror?: boolean;
name?: string;
obfuscated?: string;
refetchonexpire?: boolean;
spamfilter?: boolean | 'ipAddress' | SpamFilter;
strings?: {
Expand Down
16 changes: 14 additions & 2 deletions dist/altcha.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ declare global {

interface AltchaServerVerificationEvent extends CustomEvent<Record<string, unknown>> {}

interface AltchaWidget {
interface AltchaWidgetOptions {
analytics?: boolean | string;
auto?: 'onfocus' | 'onload' | 'onsubmit';
beaconurl?: string;
Expand All @@ -31,9 +31,10 @@ declare global {
floatingoffset?: number;
hidefooter?: boolean;
hidelogo?: boolean;
name?: string;
maxnumber?: number;
mockerror?: boolean;
name?: string;
obfuscated?: string;
refetchonexpire?: boolean;
spamfilter?: boolean | 'ipAddress';
strings?: string;
Expand All @@ -43,6 +44,16 @@ declare global {
workerurl?: string;
}

interface AltchaWidgetMethods {
configure: (options: AltchaWidgetOptions) => void;
clarify: () => Promise<void>;
reset: (newState: AltchaState = 'unverified', err: string | null = null) => void;
verify: () => Promise<void>;
}

interface AltchaWidget extends AltchaWidgetOptions extends AltchaWidgetMethods {
}

declare namespace svelteHTML {
interface IntrinsicElements {
'altcha-widget': AltchaWidgetSvelte;
Expand Down Expand Up @@ -74,6 +85,7 @@ declare global {
}

interface AltchaWidgetReact extends AltchaWidget extends React.HTMLAttributes<HTMLElement> {
children?: React.ReactNode;
ref?: React.RefObject<HTMLElement>;
style?: AltchaWidgetCSSProperties;
}
Expand Down
Loading

0 comments on commit bddbad5

Please sign in to comment.