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(5mo ago)71801.3k—7.1%21[2 PRs](https://github.com/janu-software/facebook-php-sdk/pulls)2proprietaryPHPPHP &gt;=8.3 &lt;8.6CI passing

Since Jan 7Pushed 4mo 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 2w ago

READMEChangelog (10)Dependencies (14)Versions (26)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

58

—

FairBetter than 98% of packages

Maintenance74

Regular maintenance activity

Popularity53

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity68

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

174d 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.5k6.0M777](/packages/sylius-sylius)[aws/aws-sdk-php

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

6.2k555.0M2.8k](/packages/aws-aws-sdk-php)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

36826.2k2](/packages/telnyx-telnyx-php)[openai-php/client

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

5.8k29.9M347](/packages/openai-php-client)[gotenberg/gotenberg-php

A PHP client for interacting with Gotenberg, a developer-friendly API for converting numerous document formats into PDF files, and more!

3906.6M34](/packages/gotenberg-gotenberg-php)[algolia/algoliasearch-client-php

API powering the features of Algolia.

69735.8M179](/packages/algolia-algoliasearch-client-php)

PHPackages © 2026

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