userlog / php
UserLog PHP SDK
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/userlog/php
Requires
- php: ^8.1
 - ext-curl: *
 
README
Installation
composer require userlog/php
Usage
Initialize Client
use UserLog\PHP\Client; $userlog = new Client('<API_KEY>', '<PROJECT_NAME>');
The project name will be auto-injected in all requests.
Log
// The channel name, event name and user_id are the only required parameters. $userlog->log('subscriptions', 'User subscribed!', 'user@example.com'); // Other parameters can be added when needed. $userlog->log( channel: 'subscriptions', event: 'User subscribed!', user_id: 'user@example.com', description: 'A new user subscribed to the premium plan.', icon: '👍🏼', notify: true, tags: [ 'payment-method' => 'card', 'plan' => 'monthly', ], );
Identify
// Both the user id and the properties are required. $userlog->identify( userId: 'user@example.com', properties: [ 'active' => 'yes', 'signed-in' => 'no', ], );