PHPackages                             contactlab/contacthub-sdk-php - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. contactlab/contacthub-sdk-php

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

contactlab/contacthub-sdk-php
=============================

Php SDK for ContactHub

v1.1.0(8y ago)31.0k2[2 issues](https://github.com/contactlab/contacthub-sdk-php/issues)[1 PRs](https://github.com/contactlab/contacthub-sdk-php/pulls)Apache-2.0PHPPHP &gt;=5.5

Since May 8Pushed 7y ago2 watchersCompare

[ Source](https://github.com/contactlab/contacthub-sdk-php)[ Packagist](https://packagist.org/packages/contactlab/contacthub-sdk-php)[ RSS](/packages/contactlab-contacthub-sdk-php/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (6)Versions (5)Used By (0)

ContactHub PHP SDK
==================

[](#contacthub-php-sdk)

[![Build Status](https://camo.githubusercontent.com/60bb88ab747dd02cbe1eb7ddbb9a7779d9a1ee5a895cbb1fd5cc4a00f6e35183/68747470733a2f2f7472617669732d63692e6f72672f636f6e746163746c61622f636f6e746163746875622d73646b2d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/contactlab/contacthub-sdk-php)[![Latest Stable Version](https://camo.githubusercontent.com/3d9a8336b786ac3f85e21f6ca526d42c35754c285a609578fbc6091ed58492cd/68747470733a2f2f706f7365722e707567782e6f72672f636f6e746163746c61622f636f6e746163746875622d73646b2d7068702f762f737461626c65)](https://packagist.org/packages/contactlab/contacthub-sdk-php)[![Total Downloads](https://camo.githubusercontent.com/ab58565273d71942f2ac8ca98a1ea6a6df991fe9f2b0a08f2853ac5ba03597a4/68747470733a2f2f706f7365722e707567782e6f72672f636f6e746163746c61622f636f6e746163746875622d73646b2d7068702f646f776e6c6f616473)](https://packagist.org/packages/contactlab/contacthub-sdk-php)[![License](https://camo.githubusercontent.com/88326ba34ea61e731b1db9a859b8b72e540b5a85da177261d8058d68734f3533/68747470733a2f2f706f7365722e707567782e6f72672f636f6e746163746c61622f636f6e746163746875622d73646b2d7068702f6c6963656e7365)](https://packagist.org/packages/contactlab/contacthub-sdk-php)

PHP SDK for the ContactHub API.

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

[](#installation)

```
composer require contactlab/contacthub-sdk-php
```

Documentation
-------------

[](#documentation)

Documentation can be found in the the [docs](docs) directory.

Quick start
-----------

[](#quick-start)

### Create customer

[](#create-customer)

```
use ContactHub\ContactHub;

$contactHub = new ContactHub('TOKEN', 'WORKSPACE_ID', 'NODE_ID');

$customer = [
    'externalId' => 'externalId',
    'base' => [
        'firstName' => 'First Name',
        'lastName' => 'Lastddd Name',
        'contacts' => [
            'email' => 'email@example.com'
        ]
    ],
    'extra' => 'extra string',
    'tags' => [
        'auto' => ['autotag'],
        'manual' => ['manualtag']
    ],
    'enabled' => true
];
$contactHub->addCustomer($customer);
```

### Retrieve Customers

[](#retrieve-customers)

```
use ContactHub\ContactHub;
use ContactHub\GetCustomersOptions;

$contactHub = new ContactHub('TOKEN', 'WORKSPACE_ID', 'NODE_ID');

$options = GetCustomersOptions::create()
    ->withExternalId('58ede74e05d14')
    ->withFields(['base.firstName']);
$customers = $contactHub->getCustomers($options);
```

### Create Event

[](#create-event)

```
use ContactHub\ContactHub;

$contactHub = new ContactHub('TOKEN', 'WORKSPACE_ID', 'NODE_ID');

$event = [
    'type' => EventType::VIEWED_PAGE,
    'context' => EventContext::MOBILE,
    'properties' => [
        'url' => 'http://ecommerce.event.url'
    ],
    'date' => date('c')
];

$contactHub->addEventByCustomerId('a_customer_id', $event);
```

### Query Builder

[](#query-builder)

```
use ContactHub\ContactHub;
use ContactHub\GetCustomersOptions;
use ContactHub\QueryBuilder;
use ContactHub\QueryBuilder\CombinedQuery;
use ContactHub\QueryBuilder\Condition\AtomicCondition;
use ContactHub\QueryBuilder\Condition\CompositeCondition;
use ContactHub\QueryBuilder\SimpleQuery;

$simpleWithAtomicCondition = SimpleQuery::with(AtomicCondition::where('firstName' , 'IS_NOT_NULL'));
$simpleWithCompositeCondition = SimpleQuery::with(
    CompositeCondition::where(
        'OR',
        AtomicCondition::where('base.lastName', 'IS', 'Giovanni'),
        AtomicCondition::where('base.lastName', 'IS', 'Giacomo')
    )
);
$combined = CombinedQuery::with('OR', $simpleWithCompositeCondition, $simpleWithAtomicCondition);
$query = QueryBuilder::createQuery($combined, 'named_query');

$contactHub = new ContactHub('TOKEN', 'WORKSPACE_ID', 'NODE_ID');

$options = GetCustomersOptions::create()->withQuery($query->build());
$customers = $contactHub->getCustomers($options);
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 90.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 ~38 days

Total

4

Last Release

3224d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b40daa6c3863a8de701fb0cfe3ad66c46cc0b885f609f3cc015f2c1586bd3043?d=identicon)[rukbat](/maintainers/rukbat)

![](https://www.gravatar.com/avatar/008b2a3ea14e445cf9d3cbe456883181d9275f49780edf3e39d9821e8ad546ed?d=identicon)[ernestocolombo](/maintainers/ernestocolombo)

---

Top Contributors

[![edelprino](https://avatars.githubusercontent.com/u/1643514?v=4)](https://github.com/edelprino "edelprino (82 commits)")[![giuseppeguerrisi-clab](https://avatars.githubusercontent.com/u/11315312?v=4)](https://github.com/giuseppeguerrisi-clab "giuseppeguerrisi-clab (7 commits)")[![psantori](https://avatars.githubusercontent.com/u/100616?v=4)](https://github.com/psantori "psantori (2 commits)")

---

Tags

phpcontactlabcontacthub

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/contactlab-contacthub-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/contactlab-contacthub-sdk-php/health.svg)](https://phpackages.com/packages/contactlab-contacthub-sdk-php)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.8k69.4k](/packages/grumpydictator-firefly-iii)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

5.1k4.9k](/packages/shlinkio-shlink)[getdkan/dkan

DKAN Open Data Catalog

387137.8k2](/packages/getdkan-dkan)[firefly-iii/data-importer

Firefly III Data Import Tool.

7965.8k](/packages/firefly-iii-data-importer)[mynaparrot/plugnmeet-sdk

plugNmeet PHP SDK

102.5k](/packages/mynaparrot-plugnmeet-sdk)

PHPackages © 2026

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