PHPackages                             andersbjorkland/instagram-display-extension - 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. andersbjorkland/instagram-display-extension

ActiveBolt-extension[API Development](/categories/api)

andersbjorkland/instagram-display-extension
===========================================

📸 Instagram Display Extension connects your Instagram account photos to Bolt CMS.

1.1.4(4y ago)51441[2 issues](https://github.com/andersbjorkland/instagram-display-extension/issues)MITPHP

Since Jun 17Pushed 4y ago1 watchersCompare

[ Source](https://github.com/andersbjorkland/instagram-display-extension)[ Packagist](https://packagist.org/packages/andersbjorkland/instagram-display-extension)[ RSS](/packages/andersbjorkland-instagram-display-extension/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (2)Versions (9)Used By (0)

Instagram Display Extension
===========================

[](#instagram-display-extension)

[![Showcase example of setting up and using the extension](assets/instagram-display.webp)](assets/instagram-display.webp)

Author: Anders Björkland Contact: Twitter: [@abjorkland](https://twitter.com/abjorkland)

This Bolt extension can be used to display your Instagram posts on your website. Add `{% include '@instagram-display-extension/_div.html.twig' %}` to a template where you want to display it.

An example usage with the *base-2021* theme:

```

        Latest from Instagram
        {% include '@instagram-display-extension/_div.html.twig' %}

```

The resulting section would look like this: [![Screenshot](assets/screenshot_splash.png)](assets/screenshot_splash.png)*In this example the results\_per\_page is set to 2.*

Installation:
-------------

[](#installation)

```
composer require andersbjorkland/instagram-display-extension
```

When installing this extension, there will be two tables added to your database:

- bolt\_instagram\_token - used for storing your instagram token.
- bolt\_instagram\_media - used for storing meta-information about Instagram images and video.

When using this extension, you will be fetching media via [Instagram Basic Display](https://developers.facebook.com/docs/instagram-basic-display-api). A Facebook developer account is required. You can then create an app with the Instagram Basic Display product. Use  for "Valid OAuth Redirect URIs" field. Use  for "Deauthorize Callback URL" field. Once this is done, you will find **Instagram App ID** and **Instagram App Secret**. Add these as environment variables on the form as:

```
INSTAGRAM_APP_ID=your_add_id
INSTAGRAM_APP_SECRET=your_app_secret
```

This extension will look for these environment variables and use them when you authenticate your website with your Instagram account, and on the api-calls to fetch media from your Instagram account.

If you need to add a table manually you can execute these commands:

- MySQL:

```
php bin/console doctrine:query:sql "CREATE TABLE IF NOT EXISTS bolt_instagram_token (id INT AUTO_INCREMENT NOT NULL, token VARCHAR(255) DEFAULT NULL, expires_in DATETIME DEFAULT NULL, instagram_user_id VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))"

php bin/console doctrine:query:sql "CREATE TABLE IF NOT EXISTS bolt_instagram_media (id INT AUTO_INCREMENT NOT NULL, instagram_id VARCHAR(255) NOT NULL, media_type VARCHAR(255) NOT NULL, caption LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, timestamp VARCHAR(255) NOT NULL, filepath VARCHAR(255) DEFAULT NULL, instagram_url TEXT DEFAULT NULL, permalink VARCHAR(255) DEFAULT NULL, instagram_username VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))"
```

- SQLite:

```
php bin/console doctrine:query:sql "CREATE TABLE IF NOT EXISTS bolt_instagram_token (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, token VARCHAR(255) DEFAULT NULL, expires_in DATETIME DEFAULT NULL, instagram_user_id VARCHAR(255) DEFAULT NULL)"

php bin/console doctrine:query:sql "CREATE TABLE IF NOT EXISTS bolt_instagram_media (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, instagram_id VARCHAR(255) NOT NULL, media_type VARCHAR(255) NOT NULL, caption CLOB DEFAULT NULL, timestamp VARCHAR(255) NOT NULL, instagram_url CLOB NOT NULL, filepath VARCHAR(255) DEFAULT NULL, permalink VARCHAR(255) DEFAULT NULL, instagram_username VARCHAR(255) DEFAULT NULL)"
```

- PostgreSQL:

```
php bin/console doctrine:query:sql "CREATE TABLE IF NOT EXISTS bolt_instagram_token (id INT NOT NULL, token VARCHAR(255) DEFAULT NULL, expires_in TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, instagram_user_id VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))"

php bin/console doctrine:query:sql "CREATE TABLE IF NOT EXISTS bolt_instagram_media (id INT NOT NULL, instagram_id VARCHAR(255) NOT NULL, media_type VARCHAR(255) NOT NULL, caption TEXT DEFAULT NULL, timestamp VARCHAR(255) NOT NULL, filepath VARCHAR(255) DEFAULT NULL, instagram_url TEXT DEFAULT NULL, permalink VARCHAR(255) DEFAULT NULL, instagram_username VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))"

php bin/console doctrine:query:sql "CREATE SEQUENCE IF NOT EXISTS instagram_token_id_seq INCREMENT BY 1 MINVALUE 1 START 1"

php bin/console doctrine:query:sql "CREATE SEQUENCE IF NOT EXISTS instagram_media_id_seq INCREMENT BY 1 MINVALUE 1 START 1"
```

> *A note on PostgreSQL:* If you haven't set up using it previously you may have to update `config/packages/doctrine.yaml` and change `doctrine:dbal:charset` to `utf8` if it was configured with `utf8mb` previously. Look into changing this if you see an exception with *`invalid value for parameter "client_encoding": "utf8mb4"`*.

### *Removing*

[](#removing)

If you don't want to be using the Instagram Display Extension, you may want to remove the corresponding database tables.

- MySQL

```
php bin/console doctrine:query:sql 'DROP TABLE bolt_instagram_token'
php bin/console doctrine:query:sql 'DROP TABLE bolt_instagram_media'
```

- SQLite

```
php bin/console doctrine:query:sql 'DROP TABLE bolt_instagram_token'
php bin/console doctrine:query:sql 'DROP TABLE bolt_instagram_media'
```

- PostgreSQL

```
php bin/console doctrine:query:sql "DROP SEQUENCE instagram_token_id_seq CASCADE"
php bin/console doctrine:query:sql "DROP SEQUENCE instagram_media_id_seq CASCADE"
php bin/console doctrine:query:sql "DROP TABLE bolt_instagram_token"
php bin/console doctrine:query:sql "DROP TABLE bolt_instagram_media"

```

You may also want to remove any media files stored from Instagram. Clear these in public/files/instagram, the command for this is:

```
 rm -rf public/files/instagram/
```

Using the Twig thumbnail function generates images under the directory public/thumbs. You'll find the Instagram media files under the thumbs-subdirectory corresponding to your chosen thumb-size. Using the default size will place the media-files at public/thumbs/400×300×c. Clear this directory with:

```
 rm -rf public/thumbs/400×300×c/instagram/
```

### Configuration

[](#configuration)

The configuration file is found at `config\extensions\andersbjorkland-instagramdisplayextension.yaml`.

- You can configure upload location, though default *files/instagram* is recommended to make the thumbnail-function work.
- Specify if you want the default style for the twig-partial (*\_div.html.twig*) to be active.
- Specify height and width for the media-files. This will crop the image to the specified dimensions. Setting either to null will keep the media file's original aspect ratio. Setting both to null will keep the image's original size.
- Dictate what colors to use for the pagination button and links.
- Determine if you want to show video media, and weather it should be stored on your server.

Feedback is Welcome
-------------------

[](#feedback-is-welcome)

Please reach out to me at  if you have suggestions for features or improvements. You may open issues and push requests for said issues as well.

If you want use this code in your own extension you are free to do so as it is licensed under the MIT-license. Remember to provide the same generous license for the parts that is based off of this though.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~17 days

Recently: every ~27 days

Total

8

Last Release

1670d ago

Major Versions

0.1.1 → 1.02021-06-22

### Community

Maintainers

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

---

Top Contributors

[![nicohery](https://avatars.githubusercontent.com/u/881477?v=4)](https://github.com/nicohery "nicohery (2 commits)")

---

Tags

bolt-cmsinstagram

### Embed Badge

![Health badge](/badges/andersbjorkland-instagram-display-extension/health.svg)

```
[![Health](https://phpackages.com/badges/andersbjorkland-instagram-display-extension/health.svg)](https://phpackages.com/packages/andersbjorkland-instagram-display-extension)
```

###  Alternatives

[temporal/sdk

Temporal SDK

4002.2M18](/packages/temporal-sdk)[storyblok/php-content-api-client

PHP Client for Storyblok Content API

11136.8k4](/packages/storyblok-php-content-api-client)[storyblok/php-management-api-client

Storyblok PHP Client for Management API

1224.4k1](/packages/storyblok-php-management-api-client)[smnandre/pagespeed-api

PageSpeed Insight PHP Api Client 🚀 Analyse web pages for performances metrics, core web vitals...

1511.5k](/packages/smnandre-pagespeed-api)

PHPackages © 2026

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