PHPackages                             wabel/threads-io-php-plug - 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. wabel/threads-io-php-plug

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

wabel/threads-io-php-plug
=========================

Plug Threads.io to your PHP application and start collecting events data from your users.

41502[1 issues](https://github.com/Wabel/threads-io-php-plug/issues)PHP

Since Sep 24Pushed 10y ago3 watchersCompare

[ Source](https://github.com/Wabel/threads-io-php-plug)[ Packagist](https://packagist.org/packages/wabel/threads-io-php-plug)[ RSS](/packages/wabel-threads-io-php-plug/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e43772d79e3bc73f71a2603986e03845d70c02d73722126f09caa5b5337f6fbe/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f576162656c2f746872656164732d696f2d7068702d706c75672f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Wabel/threads-io-php-plug/?branch=1.0)[![Build Status](https://camo.githubusercontent.com/517687ed4a7a31e1c4969d04798a3b5546013eec5bb5031792992ab940bf54e9/68747470733a2f2f7472617669732d63692e6f72672f576162656c2f746872656164732d696f2d7068702d706c75672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Wabel/threads-io-php-plug)[![Coverage Status](https://camo.githubusercontent.com/739bd0c4180b6b7967fa63fd749fe3ac732e59cc128aa351ff6852962b1631e9/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f576162656c2f746872656164732d696f2d7068702d706c75672f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/Wabel/threads-io-php-plug?branch=master)

Wabel's Threads.io PHP plug
===========================

[](#wabels-threadsio-php-plug)

What is this?
-------------

[](#what-is-this)

This project is a PHP connector to [Threads.io](http://threads.io). Use this plug to identify your users, track events and page visits or remove them from your Threads.io account.

Initialize
----------

[](#initialize)

Here is a basic example on how you can use Wabel's Threads.io PHP Plug :

```
use \Wabel\ThreadsIo\ThreadsIoClient;
use \Wabel\ThreadsIo\ThreadsIoService;

// The ThreadsIoClient class is the low level class used to make the API calls.
// It takes your eventKey in parameter, which is provided to you by Threads.io
$client = new ThreadsIoClient(YOUR_EVENT_KEY);

// The ThreadsIoService class is the high level class that you will use with the Entities to make your API Calls
// It takes your fresh new ThreadsIoClient object in argument to be instantiate
$service = new ThreadsIoClient($client);
```

The two main compound of this package are the **ThreadsIoClient** and **ThreadsIoService**.

The **ThreadsIoClient** is a programmatic implementation of the Threads.io API. It ensures that the data are sent with the format expected by the API. The **ThreadsIoService** is the main class to instantiate and use. It's meant to use the package Entity system, meaning manipulating **Users**, **Event** and **Page** objects easily. Every call methods expects an object implementing the **ThreadableInterface** or one of the provided Entity of this package.

Interfaces and Entites
----------------------

[](#interfaces-and-entites)

As explained earlier, the **ThreadsIoService** is manipulating entities. A User entity, Event entity or Page entity is the instantiation of an existing class of your PHP application implementing respectively the **UserThreadableInterface**, **EventThreadableInterface**, **PageThreadableInterface**. For instance, a Member class that is used for manipulating users in your application is a good candidate for implementing the **UserThreadable** interface. If you have no classes that could implement the ThreadableInterfaces, you can instantiate manually one of the Wabel\\Entities (User, Event or Page) provided in this package.

```
use \Wabel\ThreadsIo\Entities\User;
use \Wabel\ThreadsIo\Entities\Event;
use \Wabel\ThreadsIo\Entities\Page;

// Whether you retrieve an object implementing the UserThreadableInterface from your DB...
$yourUser = $dao->getMemberById(2103);

// ...or that you create one using the provided entity class User...
$threadsIoUser = new User("ID254632", [
    "name" => "Jesus Christ",
    "company" => "Christian Church",
    "date_of_birth" => "24/12/0001",
]);

...

// ... you'll be able to use them both with the ThreadsIoService
$service->identify($yourUser);
$service->identify($threadsIoUser);
```

How to use the ThreadsIoService
-------------------------------

[](#how-to-use-the-threadsioservice)

In version 1.0.0, we introduced the first use of the basic functions "identify", "track", "page" and "remove". Here's a basic usage of the service :

```
use \Wabel\ThreadsIo\Entities\User;
use \Wabel\ThreadsIo\Entities\Event;
use \Wabel\ThreadsIo\Entities\Page;
use \Wabel\ThreadsIo\ThreadsIoClient;
use \Wabel\ThreadsIo\ThreadsIoService;

// Instantiate an object that implements one of the Wabel\ThreadsIo\Interfaces
// (one of the provided classes in this case)
$user = new User("4815162342", [
     "name" => "Hugo Reyes",
     "status" => "Lost",
     "other" => "Lottery winner"
 ]);

$event = new Event("New Lost Person Report", [
     "plane" => "Oceanic 815",
     "crash_location" => "Pacific Ocean"
 ]);

$page = new Page("New plane crash: Oceanic 815 on fire in the Pacific Ocean", [
     "url" => "http://www.bignews.com/New-plane-crash-Oceanic-815-on-fire-in-the-Pacific-Ocean",
     "referer" => "http://www.bignews.com",
     "time_spent_on_page" => "18s"
 ]);

// Then grab or create a ThreadsIoService object
$client = new ThreadsIoClient($eventKey);
$service = new ThreadsIoService($client);

// Your now able to :

// Identify a user
$service->identify($user);

// Track an event
$service->track($user, $event);

// Track a page view
$service->page($user, $page);

// Remove a user
$service->remove($user);
```

About Threads.io
----------------

[](#about-threadsio)

[Threads.io](https://threads.io/) provide a service meant for sending "Automated Behavior-Driven Emails" based on user activity and workflow rules setted by the account administrator. You can consult the original API [here](https://docs.threads.io/). Feel free to make any pull requests if you notice any API upgrades.

About Wabel
-----------

[](#about-wabel)

[Wabel](http://www.wabel.com) is the online marketplace for the european food industry. In our effort to integrate our web platform to more and more web services, we (Wabel's dev team!) are happy to share our work with Threads.io's community.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5702056?v=4)[WizMik](/maintainers/WizMik)[@WizMik](https://github.com/WizMik)

![](https://www.gravatar.com/avatar/73dd84a4da5bc50dbe771f9ec430f3b99fbb970469e29936baa1b6186b6c58d8?d=identicon)[max.prudhomme](/maintainers/max.prudhomme)

---

Top Contributors

[![WizMik](https://avatars.githubusercontent.com/u/5702056?v=4)](https://github.com/WizMik "WizMik (1 commits)")

### Embed Badge

![Health badge](/badges/wabel-threads-io-php-plug/health.svg)

```
[![Health](https://phpackages.com/badges/wabel-threads-io-php-plug/health.svg)](https://phpackages.com/packages/wabel-threads-io-php-plug)
```

###  Alternatives

[spatie/laravel-google-fonts

Manage self-hosted Google Fonts in Laravel apps

4951.2M18](/packages/spatie-laravel-google-fonts)[rareloop/hatchet

1143.0k](/packages/rareloop-hatchet)

PHPackages © 2026

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