PHP
<?php
function pol_siteverify(string $token, ?string $expectedAction = null): array {
$fields = ['secret' => getenv('POL_SECRET'), 'response' => $token];
if ($expectedAction) { $fields['expected_action'] = $expectedAction; }
$ch = curl_init('https://api.heliusnetwork.app/v1/siteverify');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query($fields),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 5,
]);
$body = curl_exec($ch);
curl_close($ch);
return json_decode($body ?: '{}', true) ?: [];
}
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$result = pol_siteverify($_POST['pol-token'] ?? '');
if (empty($result['success'])) {
http_response_code(400);
exit('Please complete the Proof-of-Life check.');
}
echo 'Welcome!';
}
WordPress and similar platforms: hook the same check into the form plugin's validation filter, reading $_POST['pol-token'].
Proof-of-Life is in early access. Request keys, read the API reference or the privacy notice.