PHPackages                             janu-software/facebook-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. [API Development](/categories/api)
4. /
5. janu-software/facebook-php-sdk

ActiveLibrary[API Development](/categories/api)

janu-software/facebook-php-sdk
==============================

Alternative toolkit for Facebook Graph API

v0.4.1(2mo ago)71684.8k—2.1%22[1 PRs](https://github.com/janu-software/facebook-php-sdk/pulls)2proprietaryPHPPHP &gt;=8.3 &lt;8.6CI passing

Since Jan 7Pushed 2mo ago5 watchersCompare

[ Source](https://github.com/janu-software/facebook-php-sdk)[ Packagist](https://packagist.org/packages/janu-software/facebook-php-sdk)[ Docs](https://github.com/janu-software/facebook-php-sdk)[ Fund](https://revolut.me/stanisp8hg)[ Patreon](https://www.patreon.com/stanislavjanu)[ RSS](/packages/janu-software-facebook-php-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (25)Used By (2)

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

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

[![Composer](https://github.com/janu-software/facebook-php-sdk/actions/workflows/composer.yml/badge.svg)](https://github.com/janu-software/facebook-php-sdk/actions/workflows/composer.yml)[![Code style](https://github.com/janu-software/facebook-php-sdk/actions/workflows/code_style.yml/badge.svg)](https://github.com/janu-software/facebook-php-sdk/actions/workflows/code_style.yml)[![Tester](https://github.com/janu-software/facebook-php-sdk/actions/workflows/phpunit.yml/badge.svg)](https://github.com/janu-software/facebook-php-sdk/actions/workflows/phpunit.yml)[![PhpStan](https://github.com/janu-software/facebook-php-sdk/actions/workflows/static_analysis.yml/badge.svg)](https://github.com/janu-software/facebook-php-sdk/actions/workflows/static_analysis.yml)

[![Latest Stable Version](https://camo.githubusercontent.com/e7145b00731a8b90a8a531308ef3e0e17938f1248a38dc603d7686f66176b9cd/68747470733a2f2f706f7365722e707567782e6f72672f6a616e752d736f6674776172652f66616365626f6f6b2d7068702d73646b2f762f737461626c65)](https://packagist.org/packages/janu-software/facebook-php-sdk)[![Total Downloads](https://camo.githubusercontent.com/d3106c5f8e276e394f543915de2919040ef34c6b633866aafeed80bced9b215f/68747470733a2f2f706f7365722e707567782e6f72672f6a616e752d736f6674776172652f66616365626f6f6b2d7068702d73646b2f646f776e6c6f616473)](https://packagist.org/packages/janu-software/facebook-php-sdk)[![License](https://camo.githubusercontent.com/31f40a45189dfa4cab7aeb713859e02c7572951d7fa81f377e359dae27017ebc/68747470733a2f2f706f7365722e707567782e6f72672f6a616e752d736f6674776172652f66616365626f6f6b2d7068702d73646b2f6c6963656e7365)](https://packagist.org/packages/janu-software/facebook-php-sdk)[![codecov](https://camo.githubusercontent.com/62fd7077aa034cd7c8e91c0c1fa12138a1c5fad0235768ef415e6e7a7db08228/68747470733a2f2f636f6465636f762e696f2f67682f6a616e752d736f6674776172652f66616365626f6f6b2d7068702d73646b2f67726170682f62616467652e7376673f746f6b656e3d434f4445434f565f544f4b454e)](https://codecov.io/gh/janu-software/facebook-php-sdk)

This repository contains the open source PHP SDK that allows you to access the Facebook Platform from your PHP app. Based on `facebookarchive/php-graph-sdk` v6.

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

[](#installation)

The Facebook PHP SDK can be installed with [Composer](https://getcomposer.org/). Run this command:

```
composer require janu-software/facebook-php-sdk

```

You must use some client using `php-http/client-implementation`.

For example: Using with Guzzle:

```
composer require janu-software/facebook-php-sdk guzzlehttp/guzzle php-http/guzzle7-adapter

```

Compatibility
-------------

[](#compatibility)

VersionPHP0.1^8.00.2^8.10.3^8.10.4^8.3Usage
-----

[](#usage)

Simple GET example of a user's profile.

```
require_once __DIR__ . '/vendor/autoload.php'; // change path as needed

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

try {
  // If you provided a 'default_access_token', the '{access-token}' is optional.
  $response = $fb->get('/me', '{access-token}');
} catch(\JanuSoftware\Facebook\Exception\ResponseException $e) {
  // When Graph returns an error
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(\JanuSoftware\Facebook\Exception\SDKException $e) {
  // When validation fails or other local issues
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}

$me = $response->getGraphNode();
echo 'Logged in as ' . $me->getField('name');
```

Complete documentation, installation instructions, and examples are available [here](docs/).

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
```

License
-------

[](#license)

Please see the [license file](https://github.com/janu-software/facebook-php-sdk/blob/main/LICENSE) for more information.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you have found a security issue, please contact the maintainers directly at .

###  Health Score

60

—

FairBetter than 99% of packages

Maintenance84

Actively maintained with recent releases

Popularity53

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 97.5% 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 ~71 days

Recently: every ~188 days

Total

22

Last Release

83d ago

PHP version history (8 changes)v0.1PHP &gt;=8.0 &lt;8.2

v0.1.12PHP &gt;=8.0 &lt;=8.2

v0.1.13PHP &gt;=8.0 &lt;8.3

v0.2.0PHP &gt;=8.1 &lt;8.3

v0.2.2PHP &gt;=8.1 &lt;8.4

v0.3.1PHP &gt;=8.1 &lt;8.5

v0.4.0PHP &gt;=8.3 &lt;8.5

v0.4.1PHP &gt;=8.3 &lt;8.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/1fc7c3d8e1b1a025c720311474d67376248ca2f7bce65e9dba59b688c5d3a5ff?d=identicon)[stanislav-janu](/maintainers/stanislav-janu)

---

Top Contributors

[![stanislav-janu](https://avatars.githubusercontent.com/u/5769861?v=4)](https://github.com/stanislav-janu "stanislav-janu (117 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![spuky](https://avatars.githubusercontent.com/u/271187?v=4)](https://github.com/spuky "spuky (1 commits)")

---

Tags

facebookfacebook-apifacebook-graph-apifacebook-loginphpsdksdkfacebookgraph

###  Code Quality

TestsPHPUnit

Static AnalysisRector

### Embed Badge

![Health badge](/badges/janu-software-facebook-php-sdk/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k9.6M468](/packages/saloonphp-saloon)[php-heroku-client/php-heroku-client

A PHP client for the Heroku Platform API

24404.8k4](/packages/php-heroku-client-php-heroku-client)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[apigee/apigee-client-php

Client library for connecting to the Apigee Edge API.

27558.7k3](/packages/apigee-apigee-client-php)

PHPackages © 2026

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