PHPackages                             joomla/facebook - 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. [Framework](/categories/framework)
4. /
5. joomla/facebook

AbandonedArchivedJoomla-package[Framework](/categories/framework)

joomla/facebook
===============

Joomla Facebook Package

1.3.0(7y ago)613.8k10GPL-2.0-or-laterPHPPHP ^5.3.10|&gt;=7.0 &lt;7.2CI failing

Since Jun 4Pushed 4y ago16 watchersCompare

[ Source](https://github.com/joomla-framework/facebook-api)[ Packagist](https://packagist.org/packages/joomla/facebook)[ Docs](https://github.com/joomla-framework/facebook-api)[ RSS](/packages/joomla-facebook/feed)WikiDiscussions 2.0-dev Synced 3d ago

READMEChangelogDependencies (7)Versions (11)Used By (0)

The Facebook Package [![Build Status](https://camo.githubusercontent.com/1ba213d78c215c7617dac1e19cf4baa2a6be173e20abec35321614109172a383/68747470733a2f2f63692e6a6f6f6d6c612e6f72672f6170692f6261646765732f6a6f6f6d6c612d6672616d65776f726b2f66616365626f6f6b2d6170692f7374617475732e737667)](https://ci.joomla.org/joomla-framework/facebook-api)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#the-facebook-package-)

### Deprecated

[](#deprecated)

The `joomla/facebook` package is deprecated with no further updates planned.

### Using the Facebook Package

[](#using-the-facebook-package)

The Facebook package is designed to be a straightforward interface for working with Facebook. It is based on the Graph API. You can find documentation on the API at .

#### Instantiating Facebook

[](#instantiating-facebook)

Instantiating Facebook is easy:

```
use Joomla\Facebook\Facebook;

$facebook = new Facebook;
```

This creates a basic Facebook object that can be used to access publicly available resources on facebook.com which don't require an active access token.

Sometimes it is necessary to provide an active access token with the required permissions. This can be done by instantiating OAuth.

Create a Facebook application at  in order to request permissions. Instantiate OAuth, passing the Registry options needed. The API key, API secret and callback URL (which is the script's path) from the Facebook application are passed through the Registry object. By default you have to send headers manually in your application, but if you want this to be done automatically you can set Registry's option 'sendheaders' to true.

```
use Joomla\Facebook\Facebook;
use Joomla\Facebook\OAuth;

$options = array(
    'clientid' => $app_id,
    'clientsecret' => $app_secret,
    'redirecturi' => $callback_url,
    'sendheaders' => true,
    'authmethod' => 'get'
);

$oauth = new OAuth($options);

$facebook = new Facebook($oauth);
```

Now you can authenticate and request the user to authorise your application in order to get an access token, but if you already have an access token stored you can set it to the OAuth object and if it's still valid your application will use it.

```
// Set the stored access token.
$oauth->setToken($token);

$access_token = $oauth->authenticate();
```

When calling the authenticate() method, your stored access token will be used only if it's valid, a new one will be created if you don't have an access token or if the stored one is not valid. The method will return a valid access token that's going to be used.

Set scope to the OAuth object. Scope is a comma separated list of requested permissions:

```
$oauth->setScope('read_stream,publish_stream');
```

#### Accessing the Facebook API's objects

[](#accessing-the-facebook-apis-objects)

The Facebook package has 12 objects of the Graph API currently implemented:

- Album
- Checkin
- Comment
- Event
- Group
- Link
- Note
- Photo
- Post
- Status
- User
- Video

Once a Facebook object has been created, it is simple to use it to access Facebook:

```
$user = $facebook->user->getFeed($user_id);
```

This will retrieve an array of Post objects containing (up to) the last 25 posts.

#### A More Complete Example

[](#a-more-complete-example)

Below is an example demonstrating more of the Facebook package.

```
use Joomla\Facebook\Facebook;
use Joomla\Facebook\OAuth;

$app_id = "app_id";
$app_secret = "app_secret";
$my_url = 'http://localhost/facebook_test.php';

$options = array(
    'clientid' => $app_id,
    'clientsecret' => $app_secret,
    'redirecturi' => $callback_url,
    'sendheaders' => true,
    'authmethod' => 'get'
);

$oauth = new OAuth($options);
$oauth->authenticate();

$facebook = new Facebook($oauth);

$user = $facebook->user;
$response = $user->getFeed("me");
```

#### More Information

[](#more-information)

The following resources contain more information

- [Joomla! API Reference](http://api.joomla.org)
- [Facebook Graph API Reference](http://developers.facebook.com/docs/reference/api/)

Installation via Composer
-------------------------

[](#installation-via-composer)

Add `"joomla/facebook": "2.0.*@dev"` to the require block in your composer.json and then run `composer install`.

```
{
	"require": {
		"joomla/facebook": "2.0.*@dev"
	}
}
```

Alternatively, you can simply run the following from the command line:

```
composer require joomla/facebook "2.0.*@dev"
```

If you want to include the test sources, use

```
composer require --prefer-source joomla/facebook "~1.0"
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 57.7% 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 ~227 days

Recently: every ~409 days

Total

9

Last Release

2912d ago

PHP version history (2 changes)1.0-alphaPHP &gt;=5.3.10

1.2.0PHP ^5.3.10|&gt;=7.0 &lt;7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/305a2164440014dcef9ac681c139fe5e8a1ce1d7a8c3b3cfb828497729a4c70e?d=identicon)[wilsonge](/maintainers/wilsonge)

![](https://www.gravatar.com/avatar/875ac11cae02f9a855c88ee1db2f654b87cea1211c109c700748dce7d54e594f?d=identicon)[release-joomla](/maintainers/release-joomla)

---

Top Contributors

[![mbabker](https://avatars.githubusercontent.com/u/368545?v=4)](https://github.com/mbabker "mbabker (64 commits)")[![nibra](https://avatars.githubusercontent.com/u/827605?v=4)](https://github.com/nibra "nibra (12 commits)")[![dongilbert](https://avatars.githubusercontent.com/u/718028?v=4)](https://github.com/dongilbert "dongilbert (10 commits)")[![dianaprajescu](https://avatars.githubusercontent.com/u/1551136?v=4)](https://github.com/dianaprajescu "dianaprajescu (7 commits)")[![diananeculai](https://avatars.githubusercontent.com/u/1551136?v=4)](https://github.com/diananeculai "diananeculai (7 commits)")[![wilsonge](https://avatars.githubusercontent.com/u/1986000?v=4)](https://github.com/wilsonge "wilsonge (5 commits)")[![zero-24](https://avatars.githubusercontent.com/u/2596554?v=4)](https://github.com/zero-24 "zero-24 (2 commits)")[![joomla-jenkins](https://avatars.githubusercontent.com/u/929228?v=4)](https://github.com/joomla-jenkins "joomla-jenkins (1 commits)")[![PhilETaylor](https://avatars.githubusercontent.com/u/400092?v=4)](https://github.com/PhilETaylor "PhilETaylor (1 commits)")[![Hackwar](https://avatars.githubusercontent.com/u/313866?v=4)](https://github.com/Hackwar "Hackwar (1 commits)")[![eddieajau](https://avatars.githubusercontent.com/u/700871?v=4)](https://github.com/eddieajau "eddieajau (1 commits)")

---

Tags

facebookjoomlajoomla-frameworkphpframeworkfacebookjoomla

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/joomla-facebook/health.svg)

```
[![Health](https://phpackages.com/badges/joomla-facebook/health.svg)](https://phpackages.com/packages/joomla-facebook)
```

###  Alternatives

[joomla/oauth2

Joomla OAuth2 Package

10303.1k2](/packages/joomla-oauth2)[joomla/github

Joomla Github Package

2863.3k2](/packages/joomla-github)[joomla/http

Joomla HTTP Package

17674.4k12](/packages/joomla-http)[joomla/filter

Joomla Filter Package

151.4M8](/packages/joomla-filter)[joomla/application

Joomla Application Package

23404.8k11](/packages/joomla-application)[joomla/registry

Joomla Registry Package

16468.6k20](/packages/joomla-registry)

PHPackages © 2026

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