Evaluate an action
Evaluate an action to determine if it should be allowed, denied, or if a challenge should be triggered.
Parameters
action string
The action to evaluate. Possible values are signup and login.
signup
The action is a signup. This can be used to evaluate a signup attempt during your onboarding flow.
login
The action is a login. This can be used to evaluate a login attempt during your authentication flow.
user string
The user to evaluate.
ip string
The IP address to evaluate.
fingerprint string
The current fingerprint hash. This is the first value returned by the client SDK getHash() method. For more information, see retrieving a device hash.
last_fingerprint string
The last saved fingerprint hash. This is the second value returned by the client SDK getHash() method. For more information, see retrieving a device hash.
email string
The email address to evaluate.
phone string
The phone number to evaluate.
metadata object
Any additional metadata to evaluate.
version string
The SDK version used to generate the fingerprint hashes. Must be set to "2.32.0".
Returns
Returns an evaluation object.
const {
verdict,
challenge_id,
fingerprint_id,
reasons
} = await Rupt.evaluate({
action: "login",
user: "USER_ID",
ip: "192.168.1.1",
fingerprint: "LQJgbAnEA",
last_fingerprint: "OwZmQ",
version: "2.32.0",
email: "user@example.com",
phone: "+1234567890",
metadata: {
email: {
status: "valid",
regexp: false,
normalized_email: "user@example.com",
gibberish: false,
disposable: false,
webmail: false,
mx_records: false,
smtp_server: false,
smtp_check: false,
accept_all: false,
block: false,
}
},
});
{
"fingerprint_id": "649873be6e8b6f9b33722a0c",
"challenge_id": "649873be6e8b6f9b33722a0c",
"verdict": "challenge",
"reasons": ["new_fingerprint", "new_ip"],
"metadata": {
"email": {
"status": "valid",
"regexp": false,
"normalized_email": "user@example.com",
"gibberish": false,
"disposable": false,
"webmail": false,
"mx_records": false,
"smtp_server": false,
"smtp_check": false,
"accept_all": false,
"block": false,
}
}
},