;
}
public focus(): void {
this.elementRef.current.focus();
}
}
```
--------------------------------
### Unbranding Instances
Source: https://github.com/prosopo/captcha/blob/main/dev/ts-brand/README.md
Remove a brand from a branded instance to get back the original instance type. This is useful when you no longer need the compile-time type safety provided by the brand.
```typescript
const dogUnbranded = unbrand(dog) // of type Dog
```
--------------------------------
### Initialize Angular App with bootstrapApplication()
Source: https://github.com/prosopo/captcha/blob/main/integration/frameworks-cheat-sheet.md
Bootstrap an Angular application using bootstrapApplication. This is the standalone API for bootstrapping.
```typescript
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app/app.component';
bootstrapApplication(AppComponent);
```
--------------------------------
### Get Brand from Branded Value
Source: https://github.com/prosopo/captcha/blob/main/dev/ts-brand/README.md
Retrieve the brand associated with a branded value. If no brand is set, an empty string is returned. Note that this returns the brand as a type, not a runtime variable.
```typescript
const b = getBrand(dog) // b is of type 'Dog'
```
```typescript
const b = getBrand(someValue) // b is of type '' - i.e. no brand
```
--------------------------------
### Run Integration Tests (Standard Mode)
Source: https://github.com/prosopo/captcha/blob/main/packages/provider/src/tests/integration/README.md
Execute integration tests in standard mode, which includes running Redis containers. Use this for local development and testing.
```bash
npm run test:integration
```
--------------------------------
### POST /v1/prosopo/provider/client/solution
Source: https://context7.com/prosopo/captcha/llms.txt
Submit the user's solution for CAPTCHA verification. Requires Prosopo-Site-Key and Prosopo-User headers.
```APIDOC
## POST /v1/prosopo/provider/client/solution
### Description
Submit the user's solution for verification.
### Method
POST
### Endpoint
/v1/prosopo/provider/client/solution
### Headers
- **Prosopo-Site-Key** (string) - Required - Your site's unique key.
- **Prosopo-User** (string) - Required - The user's account address.
### Parameters
#### Request Body
- **solutions** (array) - Required - Array of captcha solutions. Each object should contain:
- **captchaId** (string) - The ID of the captcha.
- **captchaContentId** (string) - The content ID of the captcha.
- **salt** (string) - The salt used for hashing.
- **solution** (string) - The user's solution.
- **requestHash** (string) - Required - The hash of the request, obtained from the challenge response.
- **userAccount** (string) - Required - The user's account address.
- **timestamp** (string) - Required - The timestamp from the challenge response.
- **providerSignature** (string) - Required - The provider's signature from the challenge response.
- **userSignature** (string) - Required - The user's signature of the timestamp.
### Request Example
```typescript
import type { CaptchaSolution } from '@prosopo/types';
async function submitSolution(
solutions: CaptchaSolution[],
requestHash: string,
userAccount: string,
timestamp: string,
providerSignature: string,
userSignature: string
) {
const response = await providerApi.submitCaptchaSolution(
solutions,
requestHash,
userAccount,
timestamp,
providerSignature,
userSignature
);
return response;
}
```
### Response
#### Success Response (200)
- **status** (string) - Indicates the status of the request, e.g., 'ok'.
- **captchas** (array) - An array of captcha verification results.
- **captchaId** (string) - The ID of the captcha.
- **proof** (array) - Proof of the solution.
- **verified** (boolean) - Indicates if the solution was verified.
#### Response Example
```json
{
"status": "ok",
"captchas": [{ "captchaId": "abc123", "proof": [["proof1"], ["proof2"]] }],
"verified": true
}
```
```
--------------------------------
### Get Labels CLI command
Source: https://github.com/prosopo/captcha/blob/main/packages/datasets-fs/README.md
Extracts all unique labels from a given data JSON file. Use --data to specify the input file and --output for the labels file.
```bash
npm run -w @prosopo/datasets-fs build && node packages/datasets-fs/dist/cli.js labels --data ~/bench/test/flat/data2.json
```
--------------------------------
### Get Logs from a Specific Node by IP
Source: https://github.com/prosopo/captcha/blob/main/dev/flux/README.md
Fetches logs for a specific dapp running on a particular node, identified by its IP address and port. Ensure the IP and port are correctly formatted.
```bash
# get logs of a specific dapp at a specific ip
npx flux getLogs
--ip
```
--------------------------------
### Environment Variables for Production
Source: https://github.com/prosopo/captcha/blob/main/demos/client-example-server/README.md
Configure your Prosopo API credentials by replacing the placeholders in the .env.production file. Obtain your keys from the Prosopo portal.
```typescript
PROSOPO_SITE_KEY=
PROSOPO_SITE_PRIVATE_KEY=
```