PHPackages                             classy-org/classy-php-sdk - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. classy-org/classy-php-sdk

ActiveLibrary[HTTP &amp; Networking](/categories/http)

classy-org/classy-php-sdk
=========================

Php HTTP client library for Classy API

1.2.0(6y ago)818.8k3[3 issues](https://github.com/classy-org/classy-php-sdk/issues)[1 PRs](https://github.com/classy-org/classy-php-sdk/pulls)PHPCI failing

Since Apr 19Pushed 2y ago32 watchersCompare

[ Source](https://github.com/classy-org/classy-php-sdk)[ Packagist](https://packagist.org/packages/classy-org/classy-php-sdk)[ RSS](/packages/classy-org-classy-php-sdk/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (5)Dependencies (3)Versions (10)Used By (0)

Classy PHP SDK [![Build Status](https://camo.githubusercontent.com/e127418f785d9f8114f2332b2fb36cb54167a455fdfb3b73f8627e0cd89e2c57/68747470733a2f2f7472617669732d63692e6f72672f636c617373792d6f72672f636c617373792d7068702d73646b2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/classy-org/classy-php-sdk) [![codecov.io](https://camo.githubusercontent.com/685be2c695252c440f48aa368f5d1452411064ab52b5916f3f8fd66fc44e0a60/68747470733a2f2f636f6465636f762e696f2f6769746875622f636c617373792d6f72672f636c617373792d7068702d73646b2f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/github/classy-org/classy-php-sdk?branch=master)
==============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#classy-php-sdk--)

This repository contains a php HTTP client library to let your php App interact with Classy's API.

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

[](#installation)

The Classy PHP SDK can be installed with [Composer](https://getcomposer.org/):

```
composer require classy-org/classy-php-sdk
```

Be sure you included composer autoloader in your app:

```
require_once '/path/to/your/project/vendor/autoload.php';
```

Usage
-----

[](#usage)

### Basic example

[](#basic-example)

```
$client = new \Classy\Client([
    'client_id'     => 'your_client_id',
    'client_secret' => 'your_client_secret',
    'version'       => '2.0' // version of the API to be used
]);

$session = $client->newAppSession();

// Get information regarding the campaign #1234
$campaign = $client->get('/campaigns/1234', $session);

// Access the campaign goal: $campaign->goal

// Unpublish the campaign
$client->post('/campaign/1234/deactivate', $session);
```

### Sessions handling

[](#sessions-handling)

Sessions have an expiration date. It is possible to refresh a session:

```
if ($session->expired()) {
    $client->refresh($session)
}

// $session->expired() is now false.
```

Sessions are serializable, they can be saved an reused to reduce the amount of API calls:

```
$client = new \Classy\Client([
    'client_id'     => 'your_client_id',
    'client_secret' => 'your_client_secret',
    'version'       => '2.0' // version of the API to be used
]);

// Retrieve the session from a file
$session = unserialize(file_get_contents("path/to/a/cache/file"));

// ... work with the API...

// Save the session for later
file_put_contents("path/to/a/cache/file", serialize($session));
```

### Errors handling

[](#errors-handling)

This client can throw two types of Exceptions:

- Classy\\Exceptions\\SDKException when the SDK is misused
- Classy\\Exceptions\\APIResponseException when the API is not returning an OK response

```
try {
    $response = $client->get('/endpoint', $session);
} catch (\Classy\Exceptions\APIResponseException $e) {
    // Get the HTTP response code
    $code = $e->getCode();
    // Get the response content
    $content = $e->getResponseData();
    // Get the response headers
    $headers = $e->getResponseHeaders();
}
```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity69

Established project with proven stability

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

Recently: every ~335 days

Total

9

Last Release

2287d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/885331?v=4)[sholman](/maintainers/sholman)[@sholman](https://github.com/sholman)

---

Top Contributors

[![jgrisafe](https://avatars.githubusercontent.com/u/7333411?v=4)](https://github.com/jgrisafe "jgrisafe (1 commits)")[![PGBI](https://avatars.githubusercontent.com/u/6191583?v=4)](https://github.com/PGBI "PGBI (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[illuminate/http

The Illuminate Http package.

11937.2M6.5k](/packages/illuminate-http)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[dreamfactory/df-core

DreamFactory(tm) Core Components

1652.0k38](/packages/dreamfactory-df-core)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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