Skip to content
PHP wrapper for the Userlist.io API
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
test
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
LICENSE.txt
README.md
composer.json
phpunit.xml.dist

README.md

Userlist PHP Build Status

This library helps with integrating Userlist.io into PHP applications.

Installation

This library can be installed via Composer:

composer require userlistio/userlist

Configuration

The only required configuration is the Push API key. You can get your Push API key via the Push API settings in your Userlist.io account.

Configuration values can be set when creating a new push client or via environment variables. The environment takes precedence over values provided during the initialization process.

Configuration via environment variables

USERLIST_PUSH_KEY=401e5c498be718c0a38b7da7f1ce5b409c56132a49246c435ee296e07bf2be39

Configuration during initialization

$userlist = new \Userlist\Push(['push_key' => '401e5c498be718c0a38b7da7f1ce5b409c56132a49246c435ee296e07bf2be39']);

Usage

Before tracking user or event data, create a new push client. If you configured your push key via environment variables there's nothing to add. Otherwise, see the example above.

$userlist = new \Userlist\Push();

Tracking Users

$userlist->user([
    'identifier' => 'user-1',
    'email' => 'user@example.com',
    'properties' => [
        'first_name' => 'Jane',
        'last_name' => 'Doe'
    ]
]);

Tracking Events

$userlist = new \Userlist\Push();
$userlist->event([
    'name' => 'project_created',
    'user' => 'user-1',
    'properties' => [
        'name' => 'Example Project',
    ]
]);

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/userlistio/userlist-php. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The library is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Userlist project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

You can’t perform that action at this time.