Policies & conditions
A policy is one provider plus one or more conditions. Base checks the user's credential against it before signing a verification. Operators: eq, gt, gte, lt, lte, in.
| Provider | Condition | Type | Operators | Example |
|---|---|---|---|---|
x | followers | int | eq gt gte lt lte | followers gte 1000 |
x | verified | bool | eq | verified eq true |
x | verified_type | string | eq | verified_type eq blue |
coinbase | coinbase_one_active | bool | eq | coinbase_one_active eq true |
coinbase | coinbase_one_billed | bool | eq | coinbase_one_billed eq true |
instagram | followers_count | int | eq gt gte lt lte | followers_count gte 5000 |
instagram | username | string | eq | username eq base |
tiktok | follower_count | int | eq gt gte lt lte | follower_count gte 10000 |
tiktok | following_count / likes_count / video_count | int | eq gt gte lt lte | video_count gte 50 |
Declaring a policy
Return the policy from your contract's provider() and conditions(). Each Condition is { name, op, value } as strings:
function provider() external pure override returns (string memory) {
return "coinbase";
}
function conditions() external pure override returns (Condition[] memory) {
Condition[] memory c = new Condition[](1);
c[0] = Condition("coinbase_one_active", "eq", "true");
return c;
}An unsupported provider, condition, or operator makes the API return 400 invalid_policy and no verification is issued.