PHPackages                             facebook/facebook-instant-articles-sdk-php - 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. facebook/facebook-instant-articles-sdk-php

AbandonedArchivedLibrary[API Development](/categories/api)

facebook/facebook-instant-articles-sdk-php
==========================================

Facebook Instant Articles SDK for PHP

v1.10.2(5y ago)234647.0k↑20%141[12 PRs](https://github.com/facebook/facebook-instant-articles-sdk-php/pulls)5proprietaryPHPPHP ^5.4 || ^5.6 || ^7

Since Mar 16Pushed 3y ago52 watchersCompare

[ Source](https://github.com/facebook/facebook-instant-articles-sdk-php)[ Packagist](https://packagist.org/packages/facebook/facebook-instant-articles-sdk-php)[ Docs](https://github.com/facebook/facebook-instant-articles-sdk-php)[ RSS](/packages/facebook-facebook-instant-articles-sdk-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (63)Used By (5)

Facebook Instant Articles PHP SDK
=================================

[](#facebook-instant-articles-php-sdk)

[![CircleCI](https://camo.githubusercontent.com/fc627bf8b3a093b8843a555bf3bff0dd93c84425a9edbcae83b7bdd254f3256e/68747470733a2f2f636972636c6563692e636f6d2f67682f66616365626f6f6b2f66616365626f6f6b2d696e7374616e742d61727469636c65732d73646b2d7068702e7376673f7374796c653d736869656c64)](https://circleci.com/gh/facebook/facebook-instant-articles-sdk-php)[![Latest Stable Version](https://camo.githubusercontent.com/2d5b2ba3dd13347e4a7ad47e175e057156f26c74fa48d184ca9a0e2467ce8b4a/68747470733a2f2f706f7365722e707567782e6f72672f66616365626f6f6b2f66616365626f6f6b2d696e7374616e742d61727469636c65732d73646b2d7068702f762f737461626c65)](https://packagist.org/packages/facebook/facebook-instant-articles-sdk-php)

🚨 Important Note
----------------

[](#-important-note)

**⚠️ Instant Articles will not be available starting April 20, 2023**

All related developer tools will be archived.

---

The Facebook Instant Articles SDK for PHP provides a native interface for creating and publishing Instant Articles. The SDK enables developers to more easily integrate Instant Articles into content management systems and in turn enables journalist and publishers to easily publish Instant Articles.

The SDK consists of three components:

- **Elements**: A domain-specific language for creating an Instant Articles structure that strictly follows the specification and can be automatically serialized into the subset of HTML5 markup used in the [Instant Articles format](https://developers.facebook.com/docs/instant-articles/reference). This language allows users to programmatically create Instant Articles that are guaranteed to be in compliance with the format.
- **Transformer**: An engine for transforming any markup into an Instant Article structure in the DSL. The engine runs a set of rules on the markup that will specify the selection and transformation of elements output by the CMS into their Instant Articles counterparts. The transformer ships with a base set of rules for common elements (such as a basic paragraph or an image) that can be extended and customized by developers utilizing the SDK.
- **Client**: A simple wrapper around the [Instant Articles API](https://developers.facebook.com/docs/instant-articles/api), which can be used for publishing Instant Articles on Facebook. The client provides a CRUD interface for Instant Articles as well as a helper for authentication. The client depends on the main [Facebook SDK for PHP](https://github.com/facebook/facebook-php-sdk-v4) as an interface to the Graph API and Facebook Login.

Quick Start
-----------

[](#quick-start)

The Facebook Instant Articles PHP SDK can be installed with the [Composer](https://getcomposer.org/) dependency manager by running this command on your project's root folder:

```
$ composer require facebook/facebook-instant-articles-sdk-php
```

After the installation, you can include the auto loader script in your source with:

```
require_once 'vendor/autoload.php';
```

Official Documentation
----------------------

[](#official-documentation)

You can find examples on how to use the different components of this SDK to integrate it with your CMS in the [Getting Started](https://developers.facebook.com/docs/instant-articles/sdk/#getting-started) section of the documentation.

Contributing
------------

[](#contributing)

Clone the repository

```
$ git clone https://github.com/facebook/facebook-instant-articles-sdk-php.git
```

[Composer](https://getcomposer.org/) is a prerequisite for testing and developing. [Install composer globally](https://getcomposer.org/doc/00-intro.md#globally), then install project dependencies by running this command in the project's root directory:

```
$ composer install
```

To run the tests:

```
$ composer test
```

To fix and check for coding style issues:

```
$ composer cs
```

Extra lazy? Run

```
$ composer all
```

to fix and check for coding style issues, and run the tests.

If you change structure, paths, namespaces, etc., make sure you run the [autoload generator](https://getcomposer.org/doc/03-cli.md#dump-autoload):

```
$ composer dump-autoload
```

---

**For us to accept contributions you will have to first sign the [Contributor License Agreement](https://code.facebook.com/cla). Please see [CONTRIBUTING](https://github.com/facebook/facebook-instant-articles-sdk-php/blob/master/CONTRIBUTING.md) for details.**

---

Testing with Docker
-------------------

[](#testing-with-docker)

We have provide a Docker environment to ensure a consistent testing &amp; development environment.

Use `docker-compose run composer composer install` to get started.

Troubleshooting
---------------

[](#troubleshooting)

If you are encountering problems, the following tips may help in troubleshooting issues:

- Warnings from the Transformer can be seen with `$transformer->getWarnings()` method.
- If content is missing from your transformed article, more likely than not there isn't a **Transformer Rule** matching an element in your source markup. See how to configure appropriate rules for your content in the [Transformer Rules documentation](https://developers.facebook.com/docs/instant-articles/sdk/transformer-rules).
- Set the `threshold` in the transformer Logger level to `DEBUG` to expose more details about the items processed by the Transformer. `TransformerLog::setLevel(TransformerLog::DEBUG);`
- Refer to the existing [tests of the `Elements`](https://github.com/facebook/facebook-instant-articles-sdk-php/tree/master/tests/Facebook/InstantArticles/Elements) for examples of what is required of each and to potentially create your own tests (which can be run with `$ composer test`).

License
-------

[](#license)

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

Legal
-----

[](#legal)

- [Privacy](https://opensource.facebook.com/legal/privacy/)
- [Terms](https://opensource.facebook.com/legal/terms/)

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity56

Moderate usage in the ecosystem

Community45

Growing community involvement

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 51.6% 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 ~35 days

Recently: every ~282 days

Total

54

Last Release

1862d ago

Major Versions

v0.6.9 → v1.0.02016-04-10

PHP version history (4 changes)v0.1.0PHP &gt;=5.4

v0.6.4PHP &gt;=5.5

v1.0.6PHP ^5.4 || ^7.0

v1.10.0PHP ^5.4 || ^5.6 || ^7

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3757713?v=4)[Joel Marcey](/maintainers/JoelMarcey)[@JoelMarcey](https://github.com/JoelMarcey)

![](https://www.gravatar.com/avatar/456e40a47e2bfad8ea7ac69a9f56b7331e9420ccd05fc0ca28ddfc96fc2ba77b?d=identicon)[chrisackermann](/maintainers/chrisackermann)

![](https://www.gravatar.com/avatar/5a9309a051a067daca385bb8875adde72185e39bc9d6462f380e7bff4007a922?d=identicon)[evertonrosario](/maintainers/evertonrosario)

![](https://www.gravatar.com/avatar/ee0e638dee9ff9eddb4827468e06e5616820d1187015b37efdd8516184cdccfb?d=identicon)[diegoquinteiro](/maintainers/diegoquinteiro)

![](https://www.gravatar.com/avatar/e3e8c95a78c3301b3dd96ee60c7ae6fc5335853a7e4f8e10426184efdcea84ae?d=identicon)[mburak](/maintainers/mburak)

![](https://www.gravatar.com/avatar/807c0639f0343b361c00cde136abcc25e65cd6e516e2c261005b61c1942a0a9a?d=identicon)[pestevez](/maintainers/pestevez)

![](https://www.gravatar.com/avatar/571717702a22a2b937b75e2d55a7ced8864ae61f3709737577d89a124f857bd2?d=identicon)[vkama](/maintainers/vkama)

---

Top Contributors

[![everton-rosario](https://avatars.githubusercontent.com/u/996519?v=4)](https://github.com/everton-rosario "everton-rosario (324 commits)")[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (57 commits)")[![simonengelhardt](https://avatars.githubusercontent.com/u/360816?v=4)](https://github.com/simonengelhardt "simonengelhardt (57 commits)")[![diegoquinteiro](https://avatars.githubusercontent.com/u/1878108?v=4)](https://github.com/diegoquinteiro "diegoquinteiro (41 commits)")[![mburak](https://avatars.githubusercontent.com/u/944294?v=4)](https://github.com/mburak "mburak (21 commits)")[![pestevez](https://avatars.githubusercontent.com/u/18663703?v=4)](https://github.com/pestevez "pestevez (18 commits)")[![demoive](https://avatars.githubusercontent.com/u/472288?v=4)](https://github.com/demoive "demoive (17 commits)")[![gemedet](https://avatars.githubusercontent.com/u/2329661?v=4)](https://github.com/gemedet "gemedet (14 commits)")[![dodozhang21](https://avatars.githubusercontent.com/u/646064?v=4)](https://github.com/dodozhang21 "dodozhang21 (13 commits)")[![vkama](https://avatars.githubusercontent.com/u/19329804?v=4)](https://github.com/vkama "vkama (9 commits)")[![scottrigby](https://avatars.githubusercontent.com/u/407675?v=4)](https://github.com/scottrigby "scottrigby (7 commits)")[![despinoUY](https://avatars.githubusercontent.com/u/987427?v=4)](https://github.com/despinoUY "despinoUY (7 commits)")[![timjacobi](https://avatars.githubusercontent.com/u/2023165?v=4)](https://github.com/timjacobi "timjacobi (7 commits)")[![alexander-schranz](https://avatars.githubusercontent.com/u/1698337?v=4)](https://github.com/alexander-schranz "alexander-schranz (4 commits)")[![jppgks](https://avatars.githubusercontent.com/u/11156808?v=4)](https://github.com/jppgks "jppgks (3 commits)")[![nataliemt](https://avatars.githubusercontent.com/u/78859914?v=4)](https://github.com/nataliemt "nataliemt (3 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (3 commits)")[![manishbisht](https://avatars.githubusercontent.com/u/14255990?v=4)](https://github.com/manishbisht "manishbisht (2 commits)")[![dlackty](https://avatars.githubusercontent.com/u/14349?v=4)](https://github.com/dlackty "dlackty (2 commits)")[![philipjohn](https://avatars.githubusercontent.com/u/136342?v=4)](https://github.com/philipjohn "philipjohn (2 commits)")

---

Tags

instantsdkfacebookarticles

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

PHPackages © 2026

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