Configuration
The PoliPage constructor accepts an options object. Every field is optional except apiKey. Defaults match the canonical SDK behavior shared by every Poli Page SDK.
Available options
Section titled “Available options”apiKey(required) — yourpp_test_orpp_live_key.baseUrl— override the API endpoint. Defaults tohttps://api.poli.page.timeout— per-request timeout in milliseconds. Defaults to60_000.maxRetries— maximum retry attempts for retryable errors. Defaults to2(three total attempts).retryDelay— initial retry backoff in milliseconds. Defaults to500. Doubles each attempt.onRequest/onResponse/onRetry/onError— observability hooks. Never block, never mutate requests.
Example
Section titled “Example”import { PoliPage } from '@poli-page/sdk';
const client = new PoliPage({ apiKey: process.env.POLI_PAGE_API_KEY!, timeout: 30_000, maxRetries: 3, retryDelay: 250, onRequest: (event) => console.log(`→ ${event.method} ${event.url}`), onResponse: (event) => console.log(`← ${event.status} in ${event.durationMs}ms`),});