composer require apinator/apinator-phpuse Apinator\Apinator;
$client = new Apinator(
appId: 'your-app-id',
key: 'your-app-key',
secret: 'your-app-secret',
cluster: 'eu', // or 'us'
);$client->trigger(
name: 'new-message',
data: json_encode(['text' => 'Hello from PHP!']),
channel: 'chat-room',
);Set up an auth endpoint for private/presence channels:
// POST /api/realtime/auth
$socketId = $_POST['socket_id'];
$channelName = $_POST['channel_name'];
$auth = $client->authenticateChannel($socketId, $channelName);
header('Content-Type: application/json');
echo json_encode($auth);$headers = getallheaders();
$body = file_get_contents('php://input');
$client->verifyWebhook($headers, $body, maxAge: 300);
$payload = json_decode($body, true);
// Process the webhook payload...- See API Reference for all available methods
- See Laravel Integration for Laravel-specific setup