PHP code example of veridia / sdk

1. Go to this page and download the library: Download veridia/sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

veridia / sdk example snippets




use Veridia\Client;

$client = new Client([
    'credentials' => [
        'access_key_id' => 'your-access-key-id',
        'secret_access_key' => 'your-secret-access-key',
    ]
]);

$client->identify('userId', '123', [
    'email' => '[email protected]',
    'country' => 'US',
    'plan' => 'premium',
]);

$client->track('userId', '123', 'purchase', 'evt-001', gmdate('c'), [
    'productId' => 'A-1',
    'price' => 49.99,
]);

$segments = $client->getUserSegments('userId', '123');

$client->flush();

$client->close();