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

ActiveLibrary

playerlync/playerlync-sdk-php
=============================

PlayerLync SDK for PHP

4000.1.2(10y ago)0641MITPHPPHP &gt;=5.5

Since Aug 26Pushed 5y ago4 watchersCompare

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

READMEChangelogDependencies (2)Versions (6)Used By (0)

playerlync-sdk-php
==================

[](#playerlync-sdk-php)

This SDK is an open-source PHP library that makes it easy integrate your PHP application with the PlayerLync REST API

Getting Started with the PlayerLync SDK for PHP
-----------------------------------------------

[](#getting-started-with-the-playerlync-sdk-for-php)

### Autoloading &amp; Namespaces

[](#autoloading--namespaces)

The PlayerLync SDK for PHP was developed in compliance with PSR-4, meaning it relies on namespaces so that class files can be loaded automatically.

### System Requirements

[](#system-requirements)

- PHP 5.5 or greater

### Installing the PlayerLync SDK for PHP

[](#installing-the-playerlync-sdk-for-php)

There are two methods for installing the PlayerLync SDK for PHP. The recommended installation method is by using Composer. If you are unable to use Composer for your project, you can still install the SDK manually by downloading the source files and including the autoloader.

### Installing with Composer (recommended)

[](#installing-with-composer-recommended)

Composer is the recommended way to install the PlayerLync SDK for PHP. Simply add the following "require" entry to the composer.json file in the root of your project.

```
{
  "require" : {
    "playerlync/playerlync-sdk-php" : "4000.1.*"
  }
}
```

Then run composer install from the command line, and composer will download the latest version of the SDK and put it in the /vendor/ directory.

Make sure to include the Composer autoloader at the top of your script.

```
require_once __DIR__ . '/vendor/autoload.php';
```

### Loading the SDK without Composer

[](#loading-the-sdk-without-composer)

If you're not using Composer, you can download the SDK from our GitHub: [playerlync-sdk-php](https://github.com/Playerlync/playerlync-sdk-php)

Load the SDK like this:

```
define('PLAYERLYNC_SDK_PHP_SRC_DIR', '/path/to/playerlync-sdk-php/src/PlayerLync/');
require __DIR__ . '/path/to/playerlync-sdk-php/vendor/autoload.php';
```

Configuration and Setup
-----------------------

[](#configuration-and-setup)

> **This assumes you have already configured PlayerLync API access for your primary organization via the PlayerLync Admin Portal. This also assumes you have a valid PlayerLync user account, which also has access to the primary organization for which API access has been configured.**

Before we can send requests to the PlayerLync API, we need to load our app configuration into the PlayerLync\\PlayerLync service.

```
$playerlync = new \PlayerLync\PlayerLync([
        'host' => '{host}',
        'client_id' => '{client-id}',
        'client_secret' => '{client-secret}',
        'username' => '{username}',
        'password' => '{password}',
    ]);
```

You'll need to replace the {host} with the host (including scheme and port) where the PlayerLync services are running (ex: ). Replace {client-id} and {client-secret} with the values provided by your PlayerLync API access configuration, and replace {username} and {password} an account that has access to the primary organization for which the API access configuration was created.

### Authentication

[](#authentication)

The PlayerLync API relies on OAuth 2.0 for authentication. The \\PlayerLync\\PlayerLync service takes care of requesting and renewing OAuth tokens through helper classes within the SDK, assuming a valid configuration is provided. All requests to the PlayerLync API require an access token.

Making Requests to the PlayerLync API
-------------------------------------

[](#making-requests-to-the-playerlync-api)

Once you have an instance of the \\PlayerLync\\PlayerLync service and obtained an access token, you can begin making calls to the PlayerLync API.

In this example we will send a GET request to the PlayerLync API endpoint /memebers. The /members endpoint will return an array representing a collection of members for the organization associated with the access token.

```
try
{
  $playerlync = new \PlayerLync\PlayerLync([/*.....*/]);

  $response = $playerlync->get('/members', ['limit'=>50]);
  $members = $response->getData();

  echo 'API returned '. count($members) . ' members!';
}
catch(PlayerLync\Exceptions\PlayerLyncResponseException $e)
{
  // When PlayerLync API returns an error
  echo 'PlayerLync API returned an error: ' . $e->getMessage();
  exit;
}
catch(PlayerLync\Exceptions\PlayerLyncSDKException $e)
{
  // When PlayerLync SDK fails or some other local issue
  echo 'PlayerLync SDK returned an error: ' . $e->getMessage();
  exit;
}
```

In this next example, we will send a POST request to the PlayerLync API endpoint /files, to upload / replace an existing file in the PlayerLync content system.

```
try
{
  $playerlync = new \PlayerLync\PlayerLync([/*.....*/]);

  //FILE UPLOAD EXAMPLE
  $existingFileId = '';
  $filePath = '/path/to/your/file.txt';

  $data = [
      'fileid' => $existingFileId,
      'sourcefile' => $playerlync->fileToUpload($filePath)
  ];

  $response = $playerlync->post('/files', $data);

  $body = $response->getDecodedBody(); //get the full decoded JSON response
  $file = $response->getData(); //get just the "data" object from the decoded JSON response
}
catch(PlayerLync\Exceptions\PlayerLyncResponseException $e)
{
  // When PlayerLync API returns an error
  echo 'PlayerLync API returned an error: ' . $e->getMessage();
  exit;
}
catch(PlayerLync\Exceptions\PlayerLyncSDKException $e)
{
  // When PlayerLync SDK fails or some other local issue
  echo 'PlayerLync SDK returned an error: ' . $e->getMessage();
  exit;
}
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~31 days

Total

3

Last Release

3855d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/456f83d5753d3ac11cb4716d9fe460d1599ffe4d84bfc507d55036654faf4661?d=identicon)[vifootvii](/maintainers/vifootvii)

![](https://www.gravatar.com/avatar/490682694ad00db61679127e0161d375228dbebc49b2f93a05b600df4aaa153d?d=identicon)[smitrob](/maintainers/smitrob)

---

Top Contributors

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

---

Tags

sdkplayerlync

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[aws/aws-crt-php

AWS Common Runtime for PHP

420300.1M4](/packages/aws-aws-crt-php)[appwilio/cdek-sdk

CDEK API SDK (cdek.ru)

406.5k](/packages/appwilio-cdek-sdk)[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)
