Skip to main content

Getting Started 🚀

Demo​

Steps​

It takes less than 5 minutes to get started.

  1. Obtain the API key and context_id
  2. Link the Absinthe Protect authentication window to your frontend
  3. Query the EOA to get identification results

1. Obtain the API Key​

1.5 Register a context_id​

A context_id is a unique identifier to categorize and manage bot identifications effectively.

tip

Questing platforms should create a unique context_id per quest.

Each API key can create any number of context_ids. Here's how:

curl
curl --location 'https://absinthe-prod-aj5ib4l2.ue.gateway.dev/api/v1/register/context_id' \
--header 'x-api-key: <my_key>' \
--header 'Content-Type: application/json' \
--data '{
"context_title": "<my_context_title>"
}'

First install the absinthe-protect npm package.

npm i absinthe-protect #yarn add absinthe-protect

Wrap the <AbsintheProtector> around the UI element (like a button) on your site that you want to trigger the authentication window with.

tip

Questing platforms should include another button in their quest for a proof-of-humanity check through Absinthe Protect.

Here's how:

jsx
import AbsintheProtector from 'absinthe-protect';
//.
//.
//.
const [address] = await client.getAddresses() //viem compatible. Change this to be compatible with your stack.
const questContextId = "quest_num_1.dd564a35869b"
<AbsintheProtector
originSite="https://my_questing_site.xyz/questA"
eoaAddress={address}
contextId={questContextId}
>
<button>
Verify
</button>
</AbsintheProtector>

3. Query with the EOA address to get identification results​

curl
curl --location 'https://absinthe-prod-aj5ib4l2.ue.gateway.dev/api/v1/users/eoa?eoa_address=<provided_eoa_address>&context_id=<my_context_id>' \
--header 'x-api-key: <my_key>'
response
{
"success": true,
"data": {
"isBot": true,
"confidence": {
"score": 0.97
}
}
}

What this means:

  • isBot: boolean
  • This flag is set to false when a bot is not detected and to true when a bot is detected.
  • confidence: number
    • The confidence score ranges from 0 to 1 and represents the level of certainty in the accuracy of a given prediction. The closer the score is to 1, the more confident the system is about its prediction. Conversely, scores closer to 0 imply increasing levels of doubt.