PHPackages                             connect/connect-client - 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. connect/connect-client

ActiveLibrary[API Development](/categories/api)

connect/connect-client
======================

PHP Connect SDK for interacting with the Connect API

0.2.0(10y ago)187721MITPHPPHP &gt;=5.4

Since Jul 22Pushed 10y ago2 watchersCompare

[ Source](https://github.com/getconnect/connect-php)[ Packagist](https://packagist.org/packages/connect/connect-client)[ Docs](https://getconnect.io)[ RSS](/packages/connect-connect-client/feed)WikiDiscussions master Synced 1mo ago

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

Connect PHP SDK
===============

[](#connect-php-sdk)

[![Join the chat at https://gitter.im/getconnect/connect-php](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/getconnect/connect-php?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![Build Status](https://camo.githubusercontent.com/1a4a9fd54c80f29252aec8baedf6907e6566487ff8a0ec8228de34820a63f7bd/68747470733a2f2f7472617669732d63692e6f72672f676574636f6e6e6563742f636f6e6e6563742d7068702e737667)](https://travis-ci.org/getconnect/connect-php)[![Latest Stable Version](https://camo.githubusercontent.com/0d30a935750d3de0d6e366fb7f2e6a1f834928d4649d0923fe2c10e0d7f05d4d/68747470733a2f2f706f7365722e707567782e6f72672f636f6e6e6563742f636f6e6e6563742d636c69656e742f76657273696f6e)](https://packagist.org/packages/connect/connect-client)

The Connect PHP SDK allows you to push events to Connect from PHP.

If you don’t already have a Connect account, [sign up here](https://getconnect.io) - it’s free!

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

[](#installation)

The easiest way to install the Connect SDK is to use [Composer](https://getcomposer.org/).

Add `connect/connect-client` as a dependency and run composer update.

```
"require": {
    …
    "connect/connect-client" : "0.*"
    …
}

```

Usage
-----

[](#usage)

### Initializing a client

[](#initializing-a-client)

```
use Connect\Connect;

Connect::initialize('your-project-id', 'your-push-api-key');
```

### Pushing events

[](#pushing-events)

Once you have initialized Connect, you can push events easily:

```
$purchase = [
	'customer' => [
	   'firstName' => 'Tom',
	   'lastName' => 'Smith'
	],
	'product' => '12 red roses',
	'purchasePrice' => 34.95
];

Connect::push('purchases', $purchase);
```

You can also push events in batches:

```
$batch = [
	'purchases' => [
		[
            'customer' => [
                'firstName' => 'Tom',
                'lastName' => 'Smith'
			],
			'product' => '12 red roses',
			'purchasePrice' => 34.95
		],
		[
            'customer' => [
                'firstName' => 'Fred',
				'lastName' => 'Jones'
			],
			'product' => '12 pink roses',
			'purchasePrice' => 38.95
		]
	]
];

Connect::push($batch);
```

### Generating filtered keys

[](#generating-filtered-keys)

To generate a filtered key

```
$masterKey = 'YOUR_MASTER_KEY';
$keyDefinition = [
    'filters' => [
        'type' => 'cycling'
    ],
    'canQuery' => True,
    'canPush' => True
];

$filteredKey = Connect::generateFilteredKey($keyDefinition, $masterKey);
print $filteredKey;
```

### Exception handling

[](#exception-handling)

When pushing events, exceptions could be thrown, so you should either ignore or handle those exceptions gracefully.

Currently, the following exception could be thrown when pushing events:

- `InvalidEventException` - the event being pushed is invalid (e.g. invalid event properties)

License
-------

[](#license)

The SDK is released under the MIT license.

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

[](#contributing)

We love open source and welcome pull requests and issues from the community!

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72.2% 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 ~16 days

Total

3

Last Release

3921d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d3ca7fc14801187ed5c70d1fd8609c2742f5015a82432d21254f6eb0c67764b?d=identicon)[Connect](/maintainers/Connect)

---

Top Contributors

[![chadedrupt](https://avatars.githubusercontent.com/u/801839?v=4)](https://github.com/chadedrupt "chadedrupt (13 commits)")[![richard-kong](https://avatars.githubusercontent.com/u/11656618?v=4)](https://github.com/richard-kong "richard-kong (4 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")

---

Tags

eventsconnectanalytics

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[irazasyed/laravel-gamp

Send analytics data to Google Analytics from Laravel. A package for GA Measurement Protocol API

3361.6M1](/packages/irazasyed-laravel-gamp)[keen-io/keen-io

A PHP library for reporting events to the Keen IO API

1332.3M7](/packages/keen-io-keen-io)[keen-io/keen-io-bundle

Symfony Bundle for Keen IO

16488.5k](/packages/keen-io-keen-io-bundle)[ringcentral/ringcentral-php

RingCentral Platform PHP SDK

541.2M5](/packages/ringcentral-ringcentral-php)[there4/php-analytics-event

Send Google Analytics events from PHP

2441.1k](/packages/there4-php-analytics-event)[ins0/google-measurement-php-client

Server-Side PHP Client to communicate to Google Analytics over the Google Measurement Protocol

54355.8k2](/packages/ins0-google-measurement-php-client)

PHPackages © 2026

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