Pluggy.Client (PluggyAI v0.1.0)

Copy Markdown View Source

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]
)

Summary

Types

t()

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

Functions

connect_token(client, opts \\ [])

@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!(client, opts \\ [])

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

Like connect_token/2 but raises on error.

new(client_id, client_secret, opts \\ [])

@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!(client_id, client_secret, opts \\ [])

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

Like new/3 but raises on error.