PHPackages                             readdle/amplitude-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. [API Development](/categories/api)
4. /
5. readdle/amplitude-php

ActiveLibrary[API Development](/categories/api)

readdle/amplitude-php
=====================

PHP SDK for Amplitude

1.0.1(5mo ago)01.5k↓44.7%MITPHPPHP ^8.3CI passing

Since Nov 6Pushed 5mo agoCompare

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

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

Amplitude Client (PHP)
======================

[](#amplitude-client-php)

A lightweight PHP SDK for Amplitude

- Supported APIs:
    - [Analytics HTTP API v2](https://amplitude.com/docs/apis/analytics/http-v2) (send events)
    - [Identify API](https://amplitude.com/docs/apis/analytics/identify) (set/update user properties)
    - [User Privacy API](https://amplitude.com/docs/apis/analytics/user-privacy) (delete users, get deletion job statuses)
- Requirements: PHP 8.3+, ext-curl, ext-json

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

[](#installation)

Use Composer:

```
composer require readdle/amplitude-php
```

Quick Start
-----------

[](#quick-start)

```
use Readdle\AmplitudeClient\Amplitude;
use Readdle\AmplitudeClient\Model\HttpApiV2\Event;
use Readdle\AmplitudeClient\Model\IdentifyApi\Identification;

$apiKey = 'YOUR_AMPLITUDE_API_KEY';
$apiSecret = 'YOUR_AMPLITUDE_SECRET'; // optional for HTTP API v2 and Identify API

$amplitude = new Amplitude($apiKey, $apiSecret);

// 1) Send a single event (HTTP API v2)
$event = new Event();
$event->setUserId('user-123');
$event->setEventType('purchase');
$event->setRevenue(9.99);

$amplitude->httpApiV2->sendEvent($event);

// 2) Identify: set/update user properties
$identification = new Identification();
$identification->setUserId('user-123');
$identification->userProperties->set('prop1', 'value1');
$identification->userProperties->set('prop2', 'value2');

$amplitude->identifyApi->identify($identification);

// 3) User Privacy API: create a deletion job
$request = [
    'user_ids' => ['user-123', 'user-456'],
    // see Amplitude official docs for other fields
];
$amplitude->userPrivacyApi->deleteUsers($request);
```

The example/ directory contains runnable scripts that demonstrate all API calls:

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

[](#configuration)

The Amplitude class lets you override base URLs for each API via the $options argument:

```
use Readdle\AmplitudeClient\Amplitude;

$amplitude = new Amplitude(
    'API_KEY',
    'API_SECRET',
    [
        'httpApiV2' => [ 'baseUrl' => 'https://some.proxy.com' ],
        'identifyApi' => [ 'baseUrl' => 'https://some.proxy2.com' ],
        'userPrivacyApi' => [ 'baseUrl' => 'https://some.proxy3.com' ],
    ]
);
```

A named singleton instance is also available:

```
$amplitude = Amplitude::getInstance('default', 'API_KEY', 'API_SECRET');
```

Running Tests
-------------

[](#running-tests)

This project uses PHP-CS-Fixer, PHPStan and PHPUnit tests.

```
composer run cs:check
composer run cs:fix
composer run phpstan
composer run test
```

License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance70

Regular maintenance activity

Popularity20

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

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.

###  Release Activity

Cadence

Every ~21 days

Total

2

Last Release

172d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d1d01d3f75eb5b09416178c43d4be7a9dfbf06708466f7e9cbe4d98b81b9baf?d=identicon)[VladKriachko](/maintainers/VladKriachko)

---

Top Contributors

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

---

Tags

sdktrackinganalyticsamplitude

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/readdle-amplitude-php/health.svg)

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

###  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)[zumba/amplitude-php

PHP SDK for Amplitude

409.5M5](/packages/zumba-amplitude-php)[alexwestergaard/php-ga4

PHP Library for Google Analytics 4 with Server Side Tagging

63144.7k1](/packages/alexwestergaard-php-ga4)[mocking-magician/coinbase-pro-sdk

Library for coinbase pro API calls

223.2k](/packages/mocking-magician-coinbase-pro-sdk)

PHPackages © 2026

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