Configuration
PoliPage::Client.new accepts an api_key: plus a set of optional keyword arguments. Every field is optional except api_key:. Defaults match the canonical SDK behavior shared by every Poli Page SDK.
Available options
Section titled “Available options”api_key:(required) — yourpp_test_orpp_live_key.base_url:— override the API endpoint. Defaults tohttps://api.poli.page.timeout:— per-request timeout in seconds. Defaults to60.max_retries:— maximum retry attempts for retryable errors. Defaults to2(three total attempts).retry_delay:— initial retry backoff in seconds. Defaults to0.5. Doubles each attempt.logger:— aLoggerinstance; hook failures are logged here.on_retry:/on_error:— observability hooks. Never block, never mutate.proxy:— explicit proxy URL.http_proxy/https_proxyenv vars are honored automatically when this isnil.ca_file:/ca_path:— custom TLS trust store for corporate MITM proxies.
Example
Section titled “Example”require "logger"require "poli_page"
client = PoliPage::Client.new( api_key: ENV.fetch("POLI_PAGE_API_KEY"), timeout: 30, max_retries: 3, retry_delay: 0.25, logger: Logger.new($stdout), on_retry: ->(event) { puts "retry attempt #{event.attempt} after #{event.delay_ms}ms" })