Navigation

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.

Possible enum values
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 fingerprint hashes to evaluate. Use the client SDK getHash() method to get the current fingerprint hashes. 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.


Returns


Returns an evaluation object.
GET /v2/evaluate
const { 
  verdict, 
  challenge_id, 
  fingerprint_id, 
  reasons 
} = await Rupt.evaluate({
  action: "login",
  user: "USER_ID",
  ip: "192.168.1.1",
  fingerprint: ["649873be6e8b6f9b33722a0c", "649873be6e8b6f9b33722a0c"],
  email: "user@example.com",
  phone: "+1234567890",
  metadata: {
    custom_attribute: "custom_value",
  },
});
Response
{
  "fingerprint_id": "649873be6e8b6f9b33722a0c",
  "challenge_id": "649873be6e8b6f9b33722a0c",
  "verdict": "challenge",
  "reasons": ["new_fingerprint", "new_ip"],
},