Authentication
The Poli Page PHP SDK authenticates every request with a bearer token. The key prefix determines which environment the request hits.
API keys
Section titled “API keys”Pass the key to the client factory:
$client = PoliPage::client($_ENV['POLI_PAGE_API_KEY']);The SDK never reads $_ENV['POLI_PAGE_API_KEY'] implicitly. You always pass the key in.
Custom base URL
Section titled “Custom base URL”To target the develop environment (or a self-hosted gateway), use the full constructor and pass baseUrl:
$client = new PoliPage( apiKey: $_ENV['POLI_PAGE_API_KEY'], baseUrl: 'https://api-develop.poli.page',);Example
Section titled “Example”<?php
require __DIR__ . '/vendor/autoload.php';
use PoliPage\PoliPage;
$client = new PoliPage( apiKey: $_ENV['POLI_PAGE_API_KEY'], baseUrl: $_ENV['POLI_PAGE_BASE_URL'] ?? 'https://api.poli.page',);