The PHP SDK is here

Introduction

PHP is one of the most used languages and has seen a resurgence in the past decade with the rise of the mighty Laravel. So it was only right that we finally launched a PHP SDK for EnaLog which allows our customers to track their user activity in their PHP applications.

The SDK is open source and can be found on our GitHub. If you have an idea or improvement you'd like to see please feel free to open an issue and we'll be happy to discuss.

Why PHP?

Why not? It's one of the most popular languages (not most loved like Rust by the 17 people that use Rust daily 😏) but it is loved by a global community and Laravel has become one of the most loved frameworks. So we had no choice right, give the people what they want!

Using the SDK

We really focussed on keeping the SDK as simple as possible in this first release. Currently it only supports pushing events, with support for feature flags coming soon. But sending events to EnaLog is as simple as:

use EnaLog\EnaLogClient;

$enalogClient = new EnaLogClient('api-token');

$enalogClient->pushEvent([
    'project' => 'hello-world',
    'name' => 'testing-php',
    'description' => 'hello world event description',
    'icon' => '👀',
    'tags' => ['hello', 'world'],
    'meta' => ['meta' => 'data'],
    'channels' => [],
    'user_id' => '1234'
]);

That's all you need to do to start sending events to EnaLog, simple right?! We have some more information in our documentation about exceptions if you're interested in reading that. Anyway, have a nice day and look out for our next SDK announcement!