PHPackages                             userlist/userlist - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. userlist/userlist

ActiveLibrary[API Development](/categories/api)

userlist/userlist
=================

PHP wrapper for the Userlist API

v1.0.0(1y ago)046.1k↑43.3%31MITPHPPHP &gt;=7.1CI passing

Since Jul 27Pushed 1y ago2 watchersCompare

[ Source](https://github.com/userlist/userlist-php)[ Packagist](https://packagist.org/packages/userlist/userlist)[ RSS](/packages/userlist-userlist/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (1)

Userlist PHP [![Build Status](https://github.com/userlist/userlist-php/workflows/Tests/badge.svg)](https://github.com/userlist/userlist-php)
============================================================================================================================================

[](#userlist-php-)

This library helps with integrating Userlist into PHP applications.

Installation
------------

[](#installation)

This library can be installed via [Composer](https://getcomposer.org):

```
composer require userlist/userlist
```

Configuration
-------------

[](#configuration)

The only required configuration is the Push API key. You can get your Push API key via the [Push API settings](https://app.userlist.com/settings/push) in your Userlist 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
-----

[](#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

[](#tracking-users)

#### Creating &amp; updating Users

[](#creating--updating-users)

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

$userlist->users->push($user);

$userlist->user($user); // Alias
$userlist->users->create($user); // Alias
```

#### Deleting Users

[](#deleting-users)

```
$userlist->users->delete('user-1');
$userlist->users->delete($user);
```

### Tracking Companies

[](#tracking-companies)

#### Creating &amp; updating Companies

[](#creating--updating-companies)

```
$company = [
    'identifier' => 'company-1',
    'name' => 'Example, Inc.',
    'properties' => [
        'industry' => 'Software Testing'
    ]
];

$userlist->companies->push($company);

$userlist->company($company); // Alias
$userlist->companies->create($company); // Alias
```

#### Deleting Companies

[](#deleting-companies)

```
$userlist->companies->delete('company-1');
$userlist->companies->delete([ 'identifier' => 'company-1' ]);
```

### Tracking Relationships

[](#tracking-relationships)

#### Creating &amp; updating Relationships

[](#creating--updating-relationships)

```
$relationship = [
    'user' => 'user-1',
    'company' => 'company-1',
    'properties' => [
        'role' => 'admin'
    ]
];

$userlist->relationships->push($relationship);

$userlist->relationship($relationship); // Alias
$userlist->relationships->create($relationship); // Alias
```

This is equivalent to specifying the relationship on the user model.

```
$user = [
    'identifier' => 'user-1',
    'relationships' => [
        [
            'company' => 'company-1',
            'properties' => [
                'role' => 'admin'
            ]
        ]
    ],
];

$userlist->users->push($user);
```

It's also equivalent specifying the relationship on the company model.

```
$company = [
    'identifier' => 'company-1',
    'relationships' => [
        [
            'user' => 'user-1',
            'properties' => [
                'role' => 'admin'
            ]
        ]
    ],
];

$userlist->companies->push($company);
```

#### Deleting Relationships

[](#deleting-relationships)

```
$relationship = [
    'user' => 'user-1',
    'company' => 'company-1'
]

$userlist->relationships->delete($relationship);
```

### Tracking Events

[](#tracking-events)

```
$event = [
    'name' => 'project_created',
    'user' => 'user-1',
    'properties' => [
        'name' => 'Example Project',
    ]
];

$userlist->events->push($event);

$userlist->event($event); // Alias
$userlist->events->create($event); // Alias
```

### Sending Transactional Messages

[](#sending-transactional-messages)

```
$message = [
    'user' => 'user-1',
    'template' => 'welcome-email',
    'properties' => [
        'account_name' => 'Example, Inc.',
        'billing_plan' => 'Pro',
    ]
];

$userlist->messages->push($message);

$userlist->message($message); // Alias
$userlist->messages->create($message); // Alias
```

Contributing
------------

[](#contributing)

Bug reports and pull requests are welcome on GitHub at . This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

License
-------

[](#license)

The library is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

Code of Conduct
---------------

[](#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](https://github.com/userlist/userlist-php/blob/master/CODE_OF_CONDUCT.md).

What is Userlist?
-----------------

[](#what-is-userlist)

[![Userlist](https://camo.githubusercontent.com/37f1503fe05523a5c6dba2da1332ba5b312addb5033df9f0d55b8072fe99596a/68747470733a2f2f757365726c6973742e636f6d2f696d616765732f65787465726e616c2f757365726c6973742d6c6f676f2d6769746875622e737667)](https://userlist.com/)

[Userlist](https://userlist.com/) allows you to onboard and engage your SaaS users with targeted behavior-based campaigns using email or in-app messages.

Userlist was started in 2017 as an alternative to bulky enterprise messaging tools. We believe that running SaaS products should be more enjoyable. Learn more [about us](https://userlist.com/about-us/).

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance46

Moderate activity, may be stable

Popularity31

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~973 days

Total

2

Last Release

418d ago

Major Versions

v0.1.0 → v1.0.02025-03-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/338ebd04d60efe23a1e38b9f1a039f410b925404c40796cc2197cbafe8642cf3?d=identicon)[userlist](/maintainers/userlist)

---

Top Contributors

[![benedikt](https://avatars.githubusercontent.com/u/9696?v=4)](https://github.com/benedikt "benedikt (39 commits)")[![gilbitron](https://avatars.githubusercontent.com/u/203882?v=4)](https://github.com/gilbitron "gilbitron (1 commits)")[![manavo](https://avatars.githubusercontent.com/u/259487?v=4)](https://github.com/manavo "manavo (1 commits)")

---

Tags

phpuserlist

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/userlist-userlist/health.svg)

```
[![Health](https://phpackages.com/badges/userlist-userlist/health.svg)](https://phpackages.com/packages/userlist-userlist)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
