1. Go to this page and download the library: Download immobiliarelabs/braze-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/ */
immobiliarelabs / braze-sdk example snippets
use ImmobiliareLabs\BrazeSDK\ClientAdapter\SymfonyAdapter;
use Symfony\Component\HttpClient\HttpClient;
$client = HttpClient::create();
$adapter = new SymfonyAdapter($client);
use ImmobiliareLabs\BrazeSDK\Braze;
use ImmobiliareLabs\BrazeSDK\Region;
$braze = new Braze($adapter, 'my-api-key', Region::EU01);
use ImmobiliareLabs\BrazeSDK\Object\Event;
use ImmobiliareLabs\BrazeSDK\Request\Users\TrackRequest;
$event = new Event();
$event->external_id = 'user-id';
$event->app_id = 'app-id';
$event->name = 'event-name';
$event->time = new \DateTimeImmutable();
$event->properties = ['property' => 'property-value'];
$request = new TrackRequest();
$request->events = [$event];
$response = $braze->users()->track($request, false);