# `Buble.Client`
[🔗](https://github.com/bublehq/sdks/blob/main/lib/buble/client.ex#L1)

Client configuration for the Buble public API.

`Buble.Client.new/1` reads `BUBLE_API_KEY` and optional `BUBLE_BASE_URL` from
the environment when explicit options are omitted.

# `header`

```elixir
@type header() :: {String.t(), String.t()}
```

# `t`

```elixir
@type t() :: %Buble.Client{
  api_key: String.t(),
  base_url: String.t(),
  headers: [header()],
  timeout: non_neg_integer(),
  transport: module()
}
```

# `new`

```elixir
@spec new(keyword()) :: {:ok, t()} | {:error, Buble.Error.t()}
```

Creates a Buble client.

Options:

  * `:api_key` - Buble API key. Defaults to `BUBLE_API_KEY`.
  * `:base_url` - API base URL. Defaults to `BUBLE_BASE_URL` or `https://buble.ai`.
  * `:timeout` - request timeout in milliseconds. Defaults to `60_000`.
  * `:headers` - additional headers for every request.
  * `:transport` - module implementing `Buble.Transport`.

# `new!`

```elixir
@spec new!(keyword()) :: t()
```

Creates a client or raises `Buble.Error`.

---

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