PDFShift.Config (PDFShift v0.2.1)

Copy Markdown View Source

Configuration module for PDFShift API client.

Summary

Functions

Creates a new configuration with the given options.

Types

t()

@type t() :: %PDFShift.Config{api_key: String.t(), base_url: String.t()}

Functions

new(opts \\ [])

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

Creates a new configuration with the given options.

Returns {:error, reason} if no API key is available.

Options

  • :api_key - API key for authentication with PDFShift
  • :base_url - Base URL for the PDFShift API (defaults to "https://api.pdfshift.io/v3")

Examples

iex> PDFShift.Config.new(api_key: "api_key123")
{:ok, %PDFShift.Config{api_key: "api_key123", base_url: "https://api.pdfshift.io/v3"}}

iex> PDFShift.Config.new()
{:error, "API key is required. Pass api_key: "..." or set PDFSHIFT_API_KEY."}