vemetric / vemetric-php
Official PHP SDK for Vemetric
v0.2.3
2026-08-16 13:18 UTC
Requires
- php: >=8.1
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- mockery/mockery: ^1.5
- phpunit/phpunit: ^9.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
The Vemetric SDK for PHP
Learn more about the Vemetric PHP SDK in the official docs.
You can also checkout the package on Packagist.
Installation
composer require vemetric/vemetric-php
Usage
<?php require __DIR__ . '/../vendor/autoload.php'; use Vemetric\Vemetric; $vemetric = new Vemetric([ 'token' => 'YOUR_PROJECT_TOKEN', ]); // Track an event $vemetric->trackEvent('SignupCompleted', [ 'userIdentifier' => 'user-id', 'userDisplayName' => 'John Doe', 'eventData' => ['key' => 'value'], ]); // Update user data $vemetric->updateUser([ 'userIdentifier' => 'user-id', 'userData' => [ 'set' => ['key1' => 'value1'], 'setOnce' => ['key2' => 'value2'], 'unset' => ['key3'], ], ]);
Configuration
The client can be configured with the following options:
$vemetric = new Vemetric([ 'token' => 'YOUR_PROJECT_TOKEN', // Required 'host' => 'https://hub.vemetric.com', // Optional, defaults to https://hub.vemetric.com ]);