Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/content/docs/de/basics/client-side-rendering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Sie können beim Rendern der Procaptcha-Komponente jeden der folgenden CAPTCHA-T

Verschiedene Frameworks wurden mit Procaptcha integriert. Die Dokumentation für jedes Framework finden Sie unten:

- [React Integration](/de/framework-integrations/angular-integration/)
- [React Integration](/de/framework-integrations/react-integration/)
- [Vue Integration](/de/framework-integrations/vue-integration/)
- [Angular Integration](/de/framework-integrations/angular-integration/)
- [Svelte Integration](/de/framework-integrations/svelte-integration/)
Expand Down
10 changes: 5 additions & 5 deletions src/content/docs/de/basics/invisible-captcha.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Unsichtbares CAPTCHA befindet sich derzeit in der **Beta**-Phase. Funktionen und
:::

:::note[Stufen-Beschränkung]
Unsichtbares CAPTCHA ist nur für Benutzer der **Pro- und Enterprise**-Stufen verfügbar. Benutzer der kostenlosen Stufe können nicht auf diese Funktion zugreifen.
Unsichtbares CAPTCHA ist nur für Benutzer der **Professional- und Enterprise**-Stufen verfügbar. Benutzer der kostenlosen Stufe können nicht auf diese Funktion zugreifen.
:::

## Übersicht
Expand Down Expand Up @@ -219,18 +219,18 @@ const response = await fetch('https://api.prosopo.io/siteverify', {
},
body: JSON.stringify({
secret: 'your_secret_key',
response: token, // Token from Procaptcha callback
remoteip: userIP // Optional
token: token, // Token from Procaptcha callback
ip: userIP // Optional
})
});

const result = await response.json();
if (result.success) {
if (result.verified) {
// Procaptcha verified successfully
console.log('Verification successful');
} else {
// Verification failed
console.log('Verification failed:', result['error-codes']);
console.log('Verification failed:', result.status);
}
```

Expand Down
13 changes: 9 additions & 4 deletions src/content/docs/de/basics/server-side-verification.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ async function verifyToken(token) {
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({ secret: 'your_secret_key', token }),
});
return response.json().verified || false; // Return verified field, default to false
const data = await response.json();
return data.verified || false; // Return verified field, default to false
}
```
</section>
Expand Down Expand Up @@ -193,7 +194,8 @@ Um eine Benutzerantwort mit JavaScript / TypeScript zu verifizieren, importieren
die `procaptcha-response` POST-Daten. Typen können aus `@prosopo/types` importiert werden.

```typescript
import {ProsopoServer} from '@prosopo/server'
import {ProsopoServer, getServerConfig} from '@prosopo/server'
import {getPair} from '@prosopo/keyring'
import {ApiParams} from '@prosopo/types'

...
Expand All @@ -204,10 +206,13 @@ const payload = JSON.parse(event.body)
const procaptchaResponse = payload[ApiParams.procaptchaResponse]

// initialise the `ProsopoServer` class
const prosopoServer = new ProsopoServer(config)
const config = getServerConfig()
const pair = getPair(process.env.PROSOPO_SITE_PRIVATE_KEY, config.account.address)
const prosopoServer = new ProsopoServer(config, pair)

// check if the captcha response is verified
if (await prosopoServer.isVerified(procaptchaResponse)) {
const result = await prosopoServer.isVerified(procaptchaResponse)
if (result.verified) {
// perform CAPTCHA protected action
}
```
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/de/welcome/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Sie können ein vollständiges Beispiel zur Implementierung von Procaptcha in ei

Verschiedene Frameworks wurden mit Procaptcha integriert. Die Dokumentation für jedes Framework finden Sie unten:

- [React Integration](/de/framework-integrations/angular-integration/)
- [React Integration](/de/framework-integrations/react-integration/)
- [Vue Integration](/de/framework-integrations/vue-integration/)
- [Angular Integration](/de/framework-integrations/angular-integration/)
- [Svelte Integration](/de/framework-integrations/svelte-integration/)
Expand Down
20 changes: 20 additions & 0 deletions src/content/docs/en/advanced/access-control-rules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ Match requests from specific countries using ISO 3166-1 alpha-2 country codes.

**Use case:** Apply stricter or more lenient policies for specific geographic regions.

#### ASN

Match the Autonomous System Number (ASN) of the IP's network. Useful for blocking or restricting traffic from a specific hosting provider, ISP, or VPN/proxy network without enumerating every IP they own.

**Format:** Numeric AS number (e.g., `14061`, `32934`)

**Examples:** `14061` (DigitalOcean), `32934` (Meta), `13335` (Cloudflare)

**Use case:** Restrict or block traffic from cloud hosting networks frequently used by bots, or apply policies to whole ISPs in response to abuse patterns.

### Operators

Currently, only the **equals** operator is supported. The condition matches when the field value exactly equals the specified value.
Expand Down Expand Up @@ -296,6 +306,16 @@ JA4 Hash equals "t13d1516h2_8daaf6152771_a278895b5b6a"
Policy: Block
```

### ASN-Based Blocking

Restrict traffic from a whole hosting provider or ISP by AS number:

```typescript
// Restrict traffic from a cloud hosting ASN
ASN equals "14061"
Policy: Proof of Work, difficulty 5
```

## Considerations

### Account-Wide Scope
Expand Down
40 changes: 34 additions & 6 deletions src/content/docs/en/advanced/spam-filter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,44 @@ Patterns are validated when saved:

### Spam Email Domain List

A separate toggle (`spamEmailDomainCheckEnabled`) checks the email domain against a maintained list of known disposable/spam email providers. This runs independently of the rules above.
Toggle **Spam email domain checking** (`spamEmailDomainCheckEnabled`) on to block signups from known disposable and throwaway email providers — `tempmail.*`, `guerrillamail.*`, `mailinator.*` and the thousands of recycled variants spammers cycle through.

The check goes beyond matching the address's domain directly: Prosopo also follows the domain through any HTTP redirect, CNAME alias and MX record, so newly-registered throwaway domains can't bypass the list by simply pointing at a known disposable backend.

The blocklist is maintained and refreshed for you — there's nothing to configure beyond the toggle. Rejected requests come back with status `API.SPAM_EMAIL_DOMAIN`.

#### Standalone Endpoint

You can also check an address without running a full CAPTCHA verification:

```http
POST /v1/prosopo/provider/client/spam/email
Content-Type: application/json

{
"email": "user@example.com",
"dapp": "YOUR_SITE_KEY"
}
```

```json
{
"isSpam": true,
"emailDomain": "example.com"
}
```

Available to sites with the domain check enabled, and rate-limited per site key.

## Evaluation Order

When the email filter is enabled and an email is provided, rules are evaluated in this order:
When the email filter is enabled and an email is provided, the verification endpoint evaluates the email in this order:

1. **Email validity** — malformed addresses are rejected
2. **Maximum dots** — if configured, checked first
3. **Default patterns** — if enabled, evaluated next
4. **Custom regex blocklist** — each pattern is tested in order; first match wins
1. **Email validity** — malformed addresses are rejected immediately.
2. **Maximum dots** — if configured, checked first.
3. **Default patterns** — if enabled, evaluated next.
4. **Custom regex blocklist** — each pattern is tested in order; first match wins.
5. **Spam-email-domain list** — if enabled, the domain (and any redirect, CNAME or MX it points at) is checked against the maintained blocklist.

Evaluation stops at the first match. The rejection reason is recorded for audit purposes.

Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/en/advanced/traffic-filter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ Traffic filter checks run before other verification logic (captcha correctness,

## Providing the IP Address

Traffic filters require the user's IP address. Pass it in the `ip` field when calling the server-side verification endpoint:
Traffic filters always run. By default they evaluate the IP recorded when the user initiated the captcha session (the browser's IP at session-start time, captured by the provider when the widget first contacted it).

If the end user's IP may have changed between solving the captcha and your server calling `/verify` (e.g. they moved networks), pass the current IP in the optional `ip` field. The provider then re-resolves IP info against that "now" IP and runs the filters on the fresh result:

```json
{
Expand All @@ -48,8 +50,6 @@ Traffic filters require the user's IP address. Pass it in the `ip` field when ca

See the [Server-side Verification](/en/basics/server-side-verification/#optional-ip-address) docs for details.

If no IP address is provided, traffic filters are still evaluated but only the abusive-network filter will fire (using the connecting IP from the request itself).

## Filter Details

### VPN
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/basics/client-side-rendering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ You can choose to implement any of the following types of captcha when rendering

Various frameworks have been integrated with Procaptcha. You can find the documentation for each framework below:

- [React Integration](/en/framework-integrations/angular-integration/)
- [React Integration](/en/framework-integrations/react-integration/)
- [Vue Integration](/en/framework-integrations/vue-integration/)
- [Angular Integration](/en/framework-integrations/angular-integration/)
- [Svelte Integration](/en/framework-integrations/svelte-integration/)
Expand Down
10 changes: 5 additions & 5 deletions src/content/docs/en/basics/invisible-captcha.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Invisible CAPTCHA is currently in **beta**. Features and behavior may change in
:::

:::note[Tier Restriction]
Invisible CAPTCHA is only available for **Pro and Enterprise** tier users. Free tier users cannot access this feature.
Invisible CAPTCHA is only available for **Professional and Enterprise** tier users. Free tier users cannot access this feature.
:::

## Overview
Expand Down Expand Up @@ -219,18 +219,18 @@ const response = await fetch('https://api.prosopo.io/siteverify', {
},
body: JSON.stringify({
secret: 'your_secret_key',
response: token, // Token from Procaptcha callback
remoteip: userIP // Optional
token: token, // Token from Procaptcha callback
ip: userIP // Optional
})
});

const result = await response.json();
if (result.success) {
if (result.verified) {
// Procaptcha verified successfully
console.log('Verification successful');
} else {
// Verification failed
console.log('Verification failed:', result['error-codes']);
console.log('Verification failed:', result.status);
}
```

Expand Down
13 changes: 9 additions & 4 deletions src/content/docs/en/basics/server-side-verification.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ on the request. This is optional, but recommended for better accuracy. To do thi
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({secret: 'your_secret_key', token}),
});
return response.json().verified || false; // Return verified field, default to false
const data = await response.json();
return data.verified || false; // Return verified field, default to false
}
```
</section>
Expand Down Expand Up @@ -210,7 +211,8 @@ To verify a user's response using JavaScript / TypeScript, simpy import the `ver
the `procaptcha-response` POST data. Types can be imported from `@prosopo/types`.

```typescript
import {ProsopoServer} from '@prosopo/server'
import {ProsopoServer, getServerConfig} from '@prosopo/server'
import {getPair} from '@prosopo/keyring'
import {ApiParams} from '@prosopo/types'

...
Expand All @@ -221,10 +223,13 @@ const payload = JSON.parse(event.body)
const procaptchaResponse = payload[ApiParams.procaptchaResponse]

// initialise the `ProsopoServer` class
const prosopoServer = new ProsopoServer(config)
const config = getServerConfig()
const pair = getPair(process.env.PROSOPO_SITE_PRIVATE_KEY, config.account.address)
const prosopoServer = new ProsopoServer(config, pair)

// check if the captcha response is verified
if (await prosopoServer.isVerified(procaptchaResponse)) {
const result = await prosopoServer.isVerified(procaptchaResponse)
if (result.verified) {
// perform CAPTCHA protected action
}
```
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/welcome/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ of how to run the examples are in the documentation at the previous links.

Various frameworks have been integrated with Procaptcha. You can find the documentation for each framework below:

- [React Integration](/en/framework-integrations/angular-integration/)
- [React Integration](/en/framework-integrations/react-integration/)
- [Vue Integration](/en/framework-integrations/vue-integration/)
- [Angular Integration](/en/framework-integrations/angular-integration/)
- [Svelte Integration](/en/framework-integrations/svelte-integration/)
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/es/basics/client-side-rendering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Puede elegir implementar cualquiera de los siguientes tipos de captcha al render

Varios frameworks se han integrado con Procaptcha. Puede encontrar la documentación para cada framework a continuación:

- [Integración con React](/es/framework-integrations/angular-integration/)
- [Integración con React](/es/framework-integrations/react-integration/)
- [Integración con Vue](/es/framework-integrations/vue-integration/)
- [Integración con Angular](/es/framework-integrations/angular-integration/)
- [Integración con Svelte](/es/framework-integrations/svelte-integration/)
Expand Down
10 changes: 5 additions & 5 deletions src/content/docs/es/basics/invisible-captcha.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CAPTCHA invisible está actualmente en **beta**. Las características y el compo
:::

:::note[Restricción de nivel]
CAPTCHA invisible solo está disponible para usuarios de nivel **Pro y Enterprise**. Los usuarios del nivel gratuito no pueden acceder a esta función.
CAPTCHA invisible solo está disponible para usuarios de nivel **Professional y Enterprise**. Los usuarios del nivel gratuito no pueden acceder a esta función.
:::

## Descripción general
Expand Down Expand Up @@ -222,18 +222,18 @@ const response = await fetch('https://api.prosopo.io/siteverify', {
},
body: JSON.stringify({
secret: 'your_secret_key',
response: token, // Token from Procaptcha callback
remoteip: userIP // Optional
token: token, // Token from Procaptcha callback
ip: userIP // Optional
})
});

const result = await response.json();
if (result.success) {
if (result.verified) {
// Procaptcha verified successfully
console.log('Verification successful');
} else {
// Verification failed
console.log('Verification failed:', result['error-codes']);
console.log('Verification failed:', result.status);
}
```

Expand Down
13 changes: 9 additions & 4 deletions src/content/docs/es/basics/server-side-verification.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ async function verifyToken(token) {
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({ secret: 'your_secret_key', token }),
});
return response.json().verified || false; // Return verified field, default to false
const data = await response.json();
return data.verified || false; // Return verified field, default to false
}
```
</section>
Expand Down Expand Up @@ -187,7 +188,8 @@ npm install @prosopo/server
Para verificar la respuesta de un usuario usando JavaScript / TypeScript, simplemente importe la función `verify` desde `@prosopo/server` y pásele los datos POST `procaptcha-response`. Los tipos se pueden importar desde `@prosopo/types`.

```typescript
import {ProsopoServer} from '@prosopo/server'
import {ProsopoServer, getServerConfig} from '@prosopo/server'
import {getPair} from '@prosopo/keyring'
import {ApiParams} from '@prosopo/types'

...
Expand All @@ -198,10 +200,13 @@ const payload = JSON.parse(event.body)
const procaptchaResponse = payload[ApiParams.procaptchaResponse]

// initialise the `ProsopoServer` class
const prosopoServer = new ProsopoServer(config)
const config = getServerConfig()
const pair = getPair(process.env.PROSOPO_SITE_PRIVATE_KEY, config.account.address)
const prosopoServer = new ProsopoServer(config, pair)

// check if the captcha response is verified
if (await prosopoServer.isVerified(procaptchaResponse)) {
const result = await prosopoServer.isVerified(procaptchaResponse)
if (result.verified) {
// perform CAPTCHA protected action
}
```
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/es/welcome/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ de cómo ejecutar los ejemplos están en la documentación en los enlaces anteri

Varios frameworks se han integrado con Procaptcha. Puede encontrar la documentación para cada framework a continuación:

- [Integración con React](/es/framework-integrations/angular-integration/)
- [Integración con React](/es/framework-integrations/react-integration/)
- [Integración con Vue](/es/framework-integrations/vue-integration/)
- [Integración con Angular](/es/framework-integrations/angular-integration/)
- [Integración con Svelte](/es/framework-integrations/svelte-integration/)
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/fr/basics/client-side-rendering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Vous pouvez choisir d'implémenter l'un des types de captcha suivants lors du re

Différents frameworks ont été intégrés avec Procaptcha. Vous pouvez trouver la documentation pour chaque framework ci-dessous :

- [Intégration React](/fr/framework-integrations/angular-integration/)
- [Intégration React](/fr/framework-integrations/react-integration/)
- [Intégration Vue](/fr/framework-integrations/vue-integration/)
- [Intégration Angular](/fr/framework-integrations/angular-integration/)
- [Intégration Svelte](/fr/framework-integrations/svelte-integration/)
Expand Down
Loading