# `Pluggy.Client`
[🔗](https://github.com/fellipessanha/pluggy_ai_ex/blob/main/lib/pluggy/client.ex#L1)

The Pluggy API client.

Holds a configured `Req.Request` with authentication, key transformation,
and base URL setup.

## Usage

    {:ok, client} = Pluggy.Client.new("your_client_id", "your_client_secret")
    client = Pluggy.Client.new!("your_client_id", "your_client_secret")

    # With options
    {:ok, client} = Pluggy.Client.new("id", "secret",
      base_url: "https://custom.api.url",
      req_options: [receive_timeout: 30_000]
    )

# `t`

```elixir
@type t() :: %Pluggy.Client{
  client_id: String.t(),
  client_secret: String.t(),
  req: Req.Request.t()
}
```

# `connect_token`

```elixir
@spec connect_token(
  t(),
  keyword()
) :: {:ok, String.t()} | {:error, Pluggy.Error.t()}
```

Requests a connect token.

## Options

  * `:item_id` - Optional item ID to create a token for updating an existing item
  * `:options` - Optional map of connect token options

# `connect_token!`

```elixir
@spec connect_token!(
  t(),
  keyword()
) :: String.t()
```

Like `connect_token/2` but raises on error.

# `new`

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

Creates a new Pluggy client.

## Options

  * `:base_url` - Override the default Pluggy API base URL
  * `:req_options` - Additional options passed to `Req.new/1`

# `new!`

```elixir
@spec new!(String.t(), String.t(), keyword()) :: t()
```

Like `new/3` but raises on error.

---

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