# `FaroEx.Client`
[🔗](https://gitlab.com/estudio-yobo/faro/blob/v0.1.0/lib/faro_ex/client.ex#L1)

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.

# `t`

```elixir
@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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
