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

AbandonedArchivedLibrary[API Development](/categories/api)

subtech/php-sdk-v4
==================

Subtech Facebook SDK for PHP

5.4.4(9y ago)119Facebook PlatformPHPPHP ^5.4|^7.0

Since Apr 28Pushed 8y ago3 watchersCompare

[ Source](https://github.com/Sub-Tech/php-graph-sdk)[ Packagist](https://packagist.org/packages/subtech/php-sdk-v4)[ Docs](https://github.com/facebook/php-graph-sdk)[ RSS](/packages/subtech-php-sdk-v4/feed)WikiDiscussions 4.1-dev Synced 2mo ago

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

Facebook SDK for PHP
====================

[](#facebook-sdk-for-php)

For Subtech Use on 5.3 PHP Servers
----------------------------------

[](#for-subtech-use-on-53-php-servers)

`$ composer require subtech/php-sdk-v4 dev-4.1-dev`

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

[](#installation)

The Facebook PHP SDK can be installed with [Composer](https://getcomposer.org/). Add the Facebook PHP SDK package to your `composer.json` file.

```
{
    "require": {
        "subtech/php-sdk-v4": "dev-4.1-dev"
    }
}
```

Usage
-----

[](#usage)

> **Note:** This version of the Facebook SDK for PHP requires PHP 5.4 or greater.

Simple GET example of a user's profile.

```
$fb = new FacebookSubtech\Facebook([
  'app_id' => '{app-id}',
  'app_secret' => '{app-secret}',
  'default_graph_version' => 'v2.2',
  //'default_access_token' => '{access-token}', // optional
]);

// Use one of the helper classes to get a FacebookSubtech\Authentication\AccessToken entity.
//   $helper = $fb->getRedirectLoginHelper();
//   $helper = $fb->getJavaScriptHelper();
//   $helper = $fb->getCanvasHelper();
//   $helper = $fb->getPageTabHelper();

try {
  // Get the FacebookSubtech\GraphNodes\GraphUser object for the current user.
  // If you provided a 'default_access_token', the '{access-token}' is optional.
  $response = $fb->get('/me', '{access-token}');
} catch(FacebookSubtech\Exceptions\FacebookResponseException $e) {
  // When Graph returns an error
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(FacebookSubtech\Exceptions\FacebookSDKException $e) {
  // When validation fails or other local issues
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}

$me = $response->getGraphUser();
echo 'Logged in as ' . $me->getName();
```

Complete documentation, installation instructions, and examples are available at:

Tests
-----

[](#tests)

1. [Composer](https://getcomposer.org/) is a prerequisite for running the tests. Install composer globally, then run `composer install` to install required files.
2. Create a test app on [Facebook Developers](https://developers.facebook.com), then create `tests/FacebookTestCredentials.php` from `tests/FacebookTestCredentials.php.dist` and edit it to add your credentials.
3. The tests can be executed by running this command from the root directory:

```
$ ./vendor/bin/phpunit
```

By default the tests will send live HTTP requests to the Graph API. If you are without an internet connection you can skip these tests by excluding the `integration` group.

```
$ ./vendor/bin/phpunit --exclude-group integration
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

40

Last Release

3402d ago

Major Versions

4.0.23 → 5.0.02015-07-08

PHP version history (2 changes)v4.0.0PHP &gt;=5.4.0

5.1.5PHP ^5.4|^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/9f68d705c23942cba02774d2232b2fe40db024cac603b778fcb12c8ed84048c6?d=identicon)[JRSaunders](/maintainers/JRSaunders)

---

Top Contributors

[![SammyK](https://avatars.githubusercontent.com/u/578780?v=4)](https://github.com/SammyK "SammyK (85 commits)")[![gfosco](https://avatars.githubusercontent.com/u/406732?v=4)](https://github.com/gfosco "gfosco (61 commits)")[![yguedidi](https://avatars.githubusercontent.com/u/1480128?v=4)](https://github.com/yguedidi "yguedidi (31 commits)")[![JRSaunders](https://avatars.githubusercontent.com/u/6054445?v=4)](https://github.com/JRSaunders "JRSaunders (7 commits)")[![danielegrosso](https://avatars.githubusercontent.com/u/5718544?v=4)](https://github.com/danielegrosso "danielegrosso (5 commits)")[![hardik-bhadani-git](https://avatars.githubusercontent.com/u/6279697?v=4)](https://github.com/hardik-bhadani-git "hardik-bhadani-git (4 commits)")[![rpalladino](https://avatars.githubusercontent.com/u/1429151?v=4)](https://github.com/rpalladino "rpalladino (3 commits)")[![keyvanakbary](https://avatars.githubusercontent.com/u/717129?v=4)](https://github.com/keyvanakbary "keyvanakbary (3 commits)")[![alex-orbit](https://avatars.githubusercontent.com/u/192304739?v=4)](https://github.com/alex-orbit "alex-orbit (3 commits)")[![rajbdilip](https://avatars.githubusercontent.com/u/5624277?v=4)](https://github.com/rajbdilip "rajbdilip (2 commits)")[![sarciszewski](https://avatars.githubusercontent.com/u/3710836?v=4)](https://github.com/sarciszewski "sarciszewski (2 commits)")[![txptr](https://avatars.githubusercontent.com/u/2059767?v=4)](https://github.com/txptr "txptr (2 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (2 commits)")[![niraj-shah](https://avatars.githubusercontent.com/u/690705?v=4)](https://github.com/niraj-shah "niraj-shah (2 commits)")[![arturluizbr](https://avatars.githubusercontent.com/u/3036919?v=4)](https://github.com/arturluizbr "arturluizbr (2 commits)")[![bartekn](https://avatars.githubusercontent.com/u/464938?v=4)](https://github.com/bartekn "bartekn (2 commits)")[![irfanevrens](https://avatars.githubusercontent.com/u/166640?v=4)](https://github.com/irfanevrens "irfanevrens (1 commits)")[![anorgan](https://avatars.githubusercontent.com/u/1270389?v=4)](https://github.com/anorgan "anorgan (1 commits)")[![Ashpants](https://avatars.githubusercontent.com/u/1420975?v=4)](https://github.com/Ashpants "Ashpants (1 commits)")[![buzzedword](https://avatars.githubusercontent.com/u/334485?v=4)](https://github.com/buzzedword "buzzedword (1 commits)")

---

Tags

sdkfacebook

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[janu-software/facebook-php-sdk

Alternative toolkit for Facebook Graph API

71684.8k2](/packages/janu-software-facebook-php-sdk)

PHPackages © 2026

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