{"id":23081113,"url":"https://github.com/userlist/userlist-php","last_synced_at":"2025-08-15T23:31:10.683Z","repository":{"id":56273022,"uuid":"171691258","full_name":"userlist/userlist-php","owner":"userlist","description":"PHP wrapper for the Userlist Push API","archived":false,"fork":false,"pushed_at":"2025-03-26T12:55:06.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-10T01:54:08.473Z","etag":null,"topics":["php","userlist"],"latest_commit_sha":null,"homepage":"http://userlist.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/userlist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-20T14:46:55.000Z","updated_at":"2025-03-26T12:52:45.000Z","dependencies_parsed_at":"2025-03-17T15:52:52.494Z","dependency_job_id":null,"html_url":"https://github.com/userlist/userlist-php","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/userlist/userlist-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/userlist%2Fuserlist-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/userlist%2Fuserlist-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/userlist%2Fuserlist-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/userlist%2Fuserlist-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/userlist","download_url":"https://codeload.github.com/userlist/userlist-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/userlist%2Fuserlist-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270644764,"owners_count":24621332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","userlist"],"created_at":"2024-12-16T13:47:08.623Z","updated_at":"2025-08-15T23:31:10.673Z","avatar_url":"https://github.com/userlist.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Userlist PHP [![Build Status](https://github.com/userlist/userlist-php/workflows/Tests/badge.svg)](https://github.com/userlist/userlist-php)\n\nThis library helps with integrating Userlist into PHP applications.\n\n## Installation\n\nThis library can be installed via [Composer](https://getcomposer.org):\n\n```bash\ncomposer require userlist/userlist\n```\n\n## Configuration\n\nThe 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.\n\nConfiguration 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.\n\n**Configuration via environment variables**\n\n```bash\nUSERLIST_PUSH_KEY=401e5c498be718c0a38b7da7f1ce5b409c56132a49246c435ee296e07bf2be39\n```\n\n**Configuration during initialization**\n\n```php\n$userlist = new \\Userlist\\Push(['push_key' =\u003e '401e5c498be718c0a38b7da7f1ce5b409c56132a49246c435ee296e07bf2be39']);\n```\n\n## Usage\n\nBefore 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.\n\n```php\n$userlist = new \\Userlist\\Push();\n```\n\n### Tracking Users\n\n#### Creating \u0026 updating Users\n\n```php\n$user = [\n    'identifier' =\u003e 'user-1',\n    'email' =\u003e 'user@example.com',\n    'properties' =\u003e [\n        'first_name' =\u003e 'Jane',\n        'last_name' =\u003e 'Doe'\n    ]\n];\n\n$userlist-\u003eusers-\u003epush($user);\n\n$userlist-\u003euser($user); // Alias\n$userlist-\u003eusers-\u003ecreate($user); // Alias\n```\n\n#### Deleting Users\n\n```php\n$userlist-\u003eusers-\u003edelete('user-1');\n$userlist-\u003eusers-\u003edelete($user);\n```\n\n### Tracking Companies\n\n#### Creating \u0026 updating Companies\n\n```php\n$company = [\n    'identifier' =\u003e 'company-1',\n    'name' =\u003e 'Example, Inc.',\n    'properties' =\u003e [\n        'industry' =\u003e 'Software Testing'\n    ]\n];\n\n$userlist-\u003ecompanies-\u003epush($company);\n\n$userlist-\u003ecompany($company); // Alias\n$userlist-\u003ecompanies-\u003ecreate($company); // Alias\n\n```\n\n#### Deleting Companies\n\n```php\n$userlist-\u003ecompanies-\u003edelete('company-1');\n$userlist-\u003ecompanies-\u003edelete([ 'identifier' =\u003e 'company-1' ]);\n```\n\n### Tracking Relationships\n\n#### Creating \u0026 updating Relationships\n\n```php\n$relationship = [\n    'user' =\u003e 'user-1',\n    'company' =\u003e 'company-1',\n    'properties' =\u003e [\n        'role' =\u003e 'admin'\n    ]\n];\n\n$userlist-\u003erelationships-\u003epush($relationship);\n\n$userlist-\u003erelationship($relationship); // Alias\n$userlist-\u003erelationships-\u003ecreate($relationship); // Alias\n```\n\nThis is equivalent to specifying the relationship on the user model.\n\n```php\n$user = [\n    'identifier' =\u003e 'user-1',\n    'relationships' =\u003e [\n        [\n            'company' =\u003e 'company-1',\n            'properties' =\u003e [\n                'role' =\u003e 'admin'\n            ]\n        ]\n    ],\n];\n\n$userlist-\u003eusers-\u003epush($user);\n```\n\nIt's also equivalent specifying the relationship on the company model.\n\n```php\n$company = [\n    'identifier' =\u003e 'company-1',\n    'relationships' =\u003e [\n        [\n            'user' =\u003e 'user-1',\n            'properties' =\u003e [\n                'role' =\u003e 'admin'\n            ]\n        ]\n    ],\n];\n\n$userlist-\u003ecompanies-\u003epush($company);\n```\n\n#### Deleting Relationships\n\n```php\n$relationship = [\n    'user' =\u003e 'user-1',\n    'company' =\u003e 'company-1'\n]\n\n$userlist-\u003erelationships-\u003edelete($relationship);\n```\n\n### Tracking Events\n\n```php\n$event = [\n    'name' =\u003e 'project_created',\n    'user' =\u003e 'user-1',\n    'properties' =\u003e [\n        'name' =\u003e 'Example Project',\n    ]\n];\n\n$userlist-\u003eevents-\u003epush($event);\n\n$userlist-\u003eevent($event); // Alias\n$userlist-\u003eevents-\u003ecreate($event); // Alias\n```\n\n### Sending Transactional Messages\n\n```php\n$message = [\n    'user' =\u003e 'user-1',\n    'template' =\u003e 'welcome-email',\n    'properties' =\u003e [\n        'account_name' =\u003e 'Example, Inc.',\n        'billing_plan' =\u003e 'Pro',\n    ]\n];\n\n$userlist-\u003emessages-\u003epush($message);\n\n$userlist-\u003emessage($message); // Alias\n$userlist-\u003emessages-\u003ecreate($message); // Alias\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/userlist/userlist-php. 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.\n\n## License\n\nThe library is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone 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).\n\n## What is Userlist?\n\n[![Userlist](https://userlist.com/images/external/userlist-logo-github.svg)](https://userlist.com/)\n\n[Userlist](https://userlist.com/) allows you to onboard and engage your SaaS users with targeted behavior-based campaigns using email or in-app messages.\n\nUserlist 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/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuserlist%2Fuserlist-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuserlist%2Fuserlist-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuserlist%2Fuserlist-php/lists"}