PHPackages                             tj-digital/instagram - 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. tj-digital/instagram

ActiveLibrary[API Development](/categories/api)

tj-digital/instagram
====================

A PHP WordPress package that providers a connector (via ACF) to authorise and manage Instagram data and feeds

v1.5.0(1y ago)33.1k[1 PRs](https://github.com/Eleven-Miles/instagram/pulls)MITPHPPHP &gt;=7.2

Since Jun 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Eleven-Miles/instagram)[ Packagist](https://packagist.org/packages/tj-digital/instagram)[ RSS](/packages/tj-digital-instagram/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (10)Dependencies (2)Versions (13)Used By (0)

Eleven Miles: Instagram
=======================

[](#eleven-miles-instagram)

Requirements
------------

[](#requirements)

In order for the Instagram authentication process to work, you must setup a Facebook App with support for basic instagram display permissions. Once generated, add your `INSTAGRAM_CLIENT_ID` &amp; `INSTAGRAM_CLIENT_SECRET` values to your project's `.env` file (or ENV vars depending on your setup) in order to succesfully complete authentication.

Within the Facebook App, you will need to add all site urls (local, uat &amp; live) to the `Valid OAuth redirect URIs` field within the `Client OAuth Settings` section of the Instagram app settings. The format should be: `https://{your-site-url}/auth/instagram/callback`. This is the url that the application will pass to Instagram to both validate and redirect back to which is then picked up in the `/auth/instagram/callback` route and ACF options page.

You can also place this same url value in the `Deauthorize` field although this callback is not currently used in this integration.

Once this has been completed, you must then add all Instagram accounts that this integration will use (multiple are supported i.e. via a multi-site setup) to the `User Token Generator` section. This will take you through to the Facebook app roles page and at the bottom there is a section called `Instagram Testers`, here you can add Instagram account by their Instagram username. Once added, the Instagram account holder will need to logging to the Instagram website (not supported yet in the app), go to their settings, click on `Apps and websites` and then click `Tester invitations` and accept the invitation from `Tilda Feed`.

Setup
-----

[](#setup)

Must be used with ACF and is design to work with an existing custom admin settings/options page to be setup similar, using the [`NanoSoup\Nemesis\ACF\BaseFields`](https://github.com/NanoSoup/Nemesis) package as per the example below.

Once configured, you must also set the `SITE_SETTINGS_SLUG` env variable so that the router can return cms users to the site settings page once authorisation has completed via Facebook/Instagram

Note: Ensure you replace the `acf/render_field/name=` with the matching field value for your instagram field if different than `instagram_url`. The field has no bearing on the instagram account connected to the feed, this is handled during the instagram app authentication process.

```
// Add in your SiteSettings class (or similar)
use ElevenMiles\Instagram\Admin\InstagramSettings;

// Configure the instagram field reference
$prefix = 'site_settings';
$settings_fields = [
    $this->addTab($prefix, 'Social links'),
    $this->url($prefix, 'Instagram URL'),
];

acf_add_local_field_group([
    'key' => 'group_site_settings',
    'title' => 'Site Settings',
    'fields' => $settings_fields,
    // etc
]);

// Add in your SiteSettings class (or similar) admin page constructor
add_action('acf/render_field/name=instagram_url', [InstagramSettings::class, 'instagramAuthLink']);

// Add in your theme Kernel class
use ElevenMiles\Instagram\Admin\InstagramSettings;

new InstagramSettings();
```

Connecting your instagram account
---------------------------------

[](#connecting-your-instagram-account)

Once setup from a code prespective, visit your site settings page in your WP CMS and click on the `Authorise Instagram Feed` button. This will kick off the app authorisation flow via the Facebook app and Instagram account you are connecting with.

Rendering the Instagram feed
----------------------------

[](#rendering-the-instagram-feed)

To use the connected instagram

```
use ElevenMiles\Instagram\InstagramFeed;

$instagram = new InstagramFeed();
$instagram_data = $instagram->getData();

// Pass the data to your timber context, ready to use in your twig templates
$context['instagram'] = $instagram_data;
```

Basic twig templating with Instagram data (please customise as appropriate to your markup and requirements).

```
{% if instagram.results is empty %}
    {{ instagram.error }}
{% else %}
    {% for result in instagram.results %}

    {% endfor %}
{% endif %}
```

Caching
-------

[](#caching)

This package supports data caching by passing the returned Instagram data to a cache json file, which it will attempt to located from:

```
get_template_directory() . '/cache/instagram.json'
```

In order to support this, you will need to ensure that there is a cache folder in the root of your theme, and exclude it from both your theme's version control (i.e. via a `.gitignore` file) and any automated deployment processes to avoid losing the cached data when deploying changes to your site.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance42

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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 ~130 days

Recently: every ~234 days

Total

11

Last Release

472d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d165dc4e785a667b83bbbe50b3f64547e428c5c7088cb5573900b6bc106ae0c?d=identicon)[harryfinn](/maintainers/harryfinn)

---

Top Contributors

[![harryfinn](https://avatars.githubusercontent.com/u/2940866?v=4)](https://github.com/harryfinn "harryfinn (20 commits)")[![aimeehaines01](https://avatars.githubusercontent.com/u/128410866?v=4)](https://github.com/aimeehaines01 "aimeehaines01 (2 commits)")[![CBW-elevenmiles](https://avatars.githubusercontent.com/u/125652944?v=4)](https://github.com/CBW-elevenmiles "CBW-elevenmiles (2 commits)")

### Embed Badge

![Health badge](/badges/tj-digital-instagram/health.svg)

```
[![Health](https://phpackages.com/badges/tj-digital-instagram/health.svg)](https://phpackages.com/packages/tj-digital-instagram)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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