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

ActiveLibrary

gameball/gameball-php
=====================

Gameball PHP Library

v3.0.0(4y ago)04.9k1MITPHP

Since Aug 20Pushed 4y ago2 watchersCompare

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

READMEChangelog (6)DependenciesVersions (8)Used By (1)

Gameball PHP SDK
================

[](#gameball-php-sdk)

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

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

[](#documentation)

Please refer to the [Gameball API docs](https://docs.gameball.co).

### Requirements

[](#requirements)

- PHP 5.6.0 and later.

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

[](#installation)

You don't need this source code unless you want to modify the SDK. If you just want to use the SDK, just run:

### Composer

[](#composer)

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

```
composer require gameball/gameball-php
```

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

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

Dependencies
------------

[](#dependencies)

The bindings require the following extensions in order to work properly:

- [curl](https://www.php.net/manual/en/book.curl.php) although you can use your own non-cURL client if you prefer
- [json](https://www.php.net/manual/en/book.json.php)
- [mbstring](https://www.php.net/manual/en/book.mbstring.php) (Multibyte String)

If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.

Usage
-----

[](#usage)

The SDK needs to be configured with your account's API &amp; Transaction keys available in your [Gameball Dashboard](https://help.gameball.co/en/articles/3467114-get-your-account-integration-details-api-key-and-transaction-key)

### Example

[](#example)

#### Sending an Event

[](#sending-an-event)

```
// INITIALIZE PLAYER
$gameball = new \Gameball\GameballClient('Your_API_Key', 'Your_SECRET_Key');

$playerAttributes = new \Gameball\Models\PlayerAttributes();
$playerAttributes->displayName = "display_name";
$playerAttributes->firstName = 'first_name';
$playerAttributes->lastName = 'last_name';
$playerAttributes->gender = 'M';
$playerAttributes->email = 'user@example.com';
$playerAttributes->mobile = '_mobile_';
$playerAttributes->dateOfBirth = '1991-09-19T00:00:00.000Z';
$playerAttributes->joinDate = '2022-01-01T21:06:29.158Z';

$playerRequest = \Gameball\Models\PlayerRequest::factory(
        "player_unique_id",
        null, // EMAIL
        null, // MOBILE
        $playerAttributes
    );

// SEND EVENT
$eventRequest = new \Gameball\Models\EventRequest();
$eventRequest->addEvent('place_order');
$eventRequest->addMetaData('place_order','total_amount','100');
$eventRequest->addMetaData('place_order','category',array("electronics","cosmetics"));
$eventRequest->addEvent('review');

$playerRequest = \Gameball\Models\PlayerRequest::factory('player123');
$eventRequest->playerRequest = $playerRequest;

$res= $gameball->event->sendEvent($eventRequest);

// Accessing response data
echo $res->body;

// Accessing response data as JSON
echo $res->decodedJson;
```

### Handling exceptions

[](#handling-exceptions)

Unsuccessful requests raise exceptions. The raised exception will reflect the sort of error that occurred with appropriate message and error code . Please refer to the [Gameball API docs](https://docs.gameball.co).

Contribution
------------

[](#contribution)

The master branch of this repository contains the latest stable release of the SDK.

Contact
-------

[](#contact)

For usage questions\\suggestions drop us an email at support\[ at \]gameball.co. Please report any bugs as issues.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~104 days

Recently: every ~129 days

Total

6

Last Release

1565d ago

Major Versions

v1.0.4 → v3.0.02022-01-24

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e1e50ca8bd8a2a841564b1e4929588d6d08632a08ac9528c6d98a5c250d4010?d=identicon)[gameball](/maintainers/gameball)

---

Top Contributors

[![omar73H](https://avatars.githubusercontent.com/u/40579752?v=4)](https://github.com/omar73H "omar73H (7 commits)")[![aafiky](https://avatars.githubusercontent.com/u/151653989?v=4)](https://github.com/aafiky "aafiky (3 commits)")[![galal-shaban](https://avatars.githubusercontent.com/u/80773119?v=4)](https://github.com/galal-shaban "galal-shaban (3 commits)")[![Alsouidan](https://avatars.githubusercontent.com/u/47504786?v=4)](https://github.com/Alsouidan "Alsouidan (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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