FaroEx.Client (FaroEx v0.1.0)

Copy Markdown View Source

One Faro app, one base url, one API key.

Build it with FaroEx.client/1 and pass it to every call. There is deliberately no application-environment default and no process to start: a library that reads global configuration is a library that breaks the day a second app or tenant appears.

The app_id is read out of the token, which Faro mints as <appId>.<secret>. That makes it impossible to pair one app's key with another app's id — a mistake that would otherwise surface as a confusing 403 on the first send.

Summary

Types

t()

A client for one Faro app.

Types

t()

@type t() :: %FaroEx.Client{
  api_key: String.t(),
  app_id: String.t(),
  base_url: String.t(),
  connect_timeout: pos_integer(),
  receive_timeout: pos_integer()
}

A client for one Faro app.

connect_timeout and receive_timeout are milliseconds. A send blocking for a ~1000-user audience with a slow provider can take 10–20 seconds on the server's inline drain, which is why receive_timeout defaults to two minutes.