Skip to main content

Overview

score() returns a risk assessment for a user — a 0–1 score, a tier classification, the signals driving the score, and a recommendation for what to do.

Signature

Parameters

string
required
The user to score.
AbortSignal
Cancel the request.

RiskScore

Score tiers

Example signals

  • no_login_7d — no login in 7 days
  • no_login_14d — no login in 14 days
  • feature_usage_drop — feature usage fell >50% week-over-week
  • support_spike — 3+ support tickets in 7 days
  • export_all_data — exported all data (exit intent signal)
  • cancellation_page_viewed — viewed the cancellation page
  • billing_failed — recent payment failure
  • trial_expiring — trial expires within 3 days
  • downgrade_initiated — initiated a plan downgrade

Examples

Get risk score

Conditional action based on tier

In a cron job

With abort on timeout

Errors