Class: PreludeSDK::Resources::Watch

Inherits:
Object
  • Object
show all
Defined in:
lib/prelude_sdk/resources/watch.rb,
sig/prelude_sdk/resources/watch.rbs

Overview

Evaluate email addresses and phone numbers for trustworthiness.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Watch

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Watch.

Parameters:



106
107
108
# File 'lib/prelude_sdk/resources/watch.rb', line 106

def initialize(client:)
  @client = client
end

Instance Method Details

#predict(target:, dispatch_id: nil, metadata: nil, signals: nil, request_options: {}) ⇒ PreludeSDK::Models::WatchPredictResponse

Some parameter documentations has been truncated, see Models::WatchPredictParams for more details.

At signup, score the user's phone number or email address (target) as legitimate or suspicious. Scoring-only — does not update counters by itself. When using Feedback, call predict before verification.started on the same target (and correlation_id when used) so feedback can warm Watch auth-start counters. Use Events for product fraud labels; use Feedback only if you run your own phone verification funnel outside Prelude Verify.

Parameters:

Returns:

See Also:



32
33
34
35
36
37
38
39
40
41
# File 'lib/prelude_sdk/resources/watch.rb', line 32

def predict(params)
  parsed, options = PreludeSDK::WatchPredictParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v2/watch/predict",
    body: parsed,
    model: PreludeSDK::Models::WatchPredictResponse,
    options: options
  )
end

#send_events(events:, request_options: {}) ⇒ PreludeSDK::Models::WatchSendEventsResponse

Some parameter documentations has been truncated, see Models::WatchSendEventsParams for more details.

Send custom fraud signals from your application (labels and confidence levels). Events capture product-specific risk patterns and are weighted when scoring traffic. Use without Predict or Feedback if you only need to report product-side abuse (for example account.banned). Feedback is a separate, optional endpoint for self-hosted phone verification funnels.

Parameters:

Returns:

See Also:



61
62
63
64
65
66
67
68
69
70
# File 'lib/prelude_sdk/resources/watch.rb', line 61

def send_events(params)
  parsed, options = PreludeSDK::WatchSendEventsParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v2/watch/event",
    body: parsed,
    model: PreludeSDK::Models::WatchSendEventsResponse,
    options: options
  )
end

#send_feedbacks(feedbacks:, request_options: {}) ⇒ PreludeSDK::Models::WatchSendFeedbacksResponse

Some parameter documentations has been truncated, see Models::WatchSendFeedbacksParams for more details.

Optional. Report verification-funnel steps (verification.started, verification.completed) when you run phone verification outside Prelude Verify. Feeds Watch abuse-rate counters for your own flow. Call Predict on the same target before verification.started and reuse metadata.correlation_id so auth-start counters receive predict signals; without a linked predict, only attempt-rate counters update on started. Not required if you only use Events and/or Predict, or if Verify already handles verification for that traffic.

Parameters:

Returns:

See Also:



92
93
94
95
96
97
98
99
100
101
# File 'lib/prelude_sdk/resources/watch.rb', line 92

def send_feedbacks(params)
  parsed, options = PreludeSDK::WatchSendFeedbacksParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v2/watch/feedback",
    body: parsed,
    model: PreludeSDK::Models::WatchSendFeedbacksResponse,
    options: options
  )
end