PHPackages                             trophy/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. trophy/php

ActiveLibrary[API Development](/categories/api)

trophy/php
==========

Trophy PHP Library

11PHPCI passing

Since Sep 23Pushed 7mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Trophy PHP SDK
==============

[](#trophy-php-sdk)

The Trophy PHP SDK provides convenient access to the Trophy API from applications written in PHP.

Trophy provides APIs and tools for adding gamification to your application, keeping users engaged through rewards, achievements, streaks, and personalized communication.

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

[](#installation)

You can install the bindings via [Composer](http://getcomposer.org/). Run the following command:

```
composer require trophyso/php
```

To use the bindings, use the Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):

```
require_once('vendor/autoload.php');
```

Usage
-----

[](#usage)

The package needs to be configured with your account's API key, which is available in the Trophy web interface. Set the API key with the following:

```
use Trophy\TrophyClient;
use Trophy\Metrics\Requests\MetricsEventRequest;
use Trophy\Types\EventRequestUser;

$trophy = new TrophyClient('your-api-key');
```

Then you can access the Trophy API through the `$trophy` client. For example, you can send a metric event:

```
// Create a new user object
$user = new EventRequestUser([
    'id' => '18',
    'email' => 'jk.rowling@harrypotter.com'
]);

// Create a new MetricsEventRequest object
$request = new MetricsEventRequest([
    'user' => $user,
    'value' => 750
]);

// Send the event to the Trophy API
$trophy->metrics->event("words-written", $request);
```

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

[](#documentation)

See the [Trophy API Docs](https://docs.trophy.so) for more information on the accessible endpoints.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance43

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

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

### Community

Maintainers

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

---

Top Contributors

[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (33 commits)")[![jasontlouro](https://avatars.githubusercontent.com/u/33489988?v=4)](https://github.com/jasontlouro "jasontlouro (1 commits)")

---

Tags

apiapi-clientgamificationgamification-enginegamification-frameworkgamification-platformlaravelphpsdk

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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