Buble.Client (buble v0.1.0)

Copy Markdown View Source

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.

Summary

Functions

Creates a Buble client.

Creates a client or raises Buble.Error.

Types

header()

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

t()

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

Functions

new(opts \\ [])

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

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

Creates a client or raises Buble.Error.