Class: Velix::Modules::Checkin

Inherits:
Object
  • Object
show all
Defined in:
lib/velix/modules/checkin.rb

Overview

POST /v1/api/checkin/identify — scope checkin:write

Liveness score is never returned by the API by design (security rule) — this endpoint's response only ever reports matched, never a raw liveness/confidence score.

Defined Under Namespace

Classes: Result

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Checkin

Returns a new instance of Checkin.



13
14
15
# File 'lib/velix/modules/checkin.rb', line 13

def initialize(client)
  @client = client
end

Instance Method Details

#identify(image_base64:, images: nil, top_k: nil, liveness: nil, location: nil) ⇒ Object

image_base64: main frame, required images: optional array of extra base64 frames top_k: optional integer 1..10 liveness: optional { token:, samples: [{ action:, image_base64: }] } location: optional { latitude:, longitude:, accuracy: }



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/velix/modules/checkin.rb', line 22

def identify(image_base64:, images: nil, top_k: nil, liveness: nil, location: nil)
  body = { imageBase64: image_base64 }
  body[:images] = images if images
  body[:topK] = top_k if top_k
  body[:liveness] = serialize_liveness(liveness) if liveness
  body[:location] = location if location

  resp = @client.post("/v1/api/checkin/identify", body)

  Result.new(
    matched: resp["matched"],
    person_id: resp["person_id"],
    quality_score: resp["quality_score"],
    message: resp["message"]
  )
end