PHPackages                             enovate/social-stream - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. enovate/social-stream

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

enovate/social-stream
=====================

Pull posts from Instagram (and other social platforms) into Craft CMS templates

1.2.0(2mo ago)0141↓88.9%proprietaryPHPPHP ^8.2

Since Apr 21Pushed 2mo agoCompare

[ Source](https://github.com/enovatedesign/social-stream)[ Packagist](https://packagist.org/packages/enovate/social-stream)[ RSS](/packages/enovate-social-stream/feed)WikiDiscussions main Synced 1w ago

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

Social Stream for Craft CMS
===========================

[](#social-stream-for-craft-cms)

A Craft CMS 5 plugin for pulling Instagram posts into your templates via the Instagram Graph API. Supports stream filtering, carousel children, caching with stale-while-revalidate, and multi-site configurations.

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

[](#requirements)

- Craft CMS 5.0 or later
- PHP 8.2 or later
- An Instagram **Business** or **Creator** account linked to a Meta Business Suite page
- A Meta App with the Instagram product configured

Installation
------------

[](#installation)

Install via Composer:

```
composer require enovate/social-stream
```

Then install the plugin via the Craft CP under **Settings &gt; Plugins**, or from the command line:

```
php craft plugin/install social-stream
```

---

Meta App Setup
--------------

[](#meta-app-setup)

### 1. Create a Meta App

[](#1-create-a-meta-app)

1. Go to [Meta for Developers](https://developers.facebook.com/apps/) and create a new app.
2. Give it a name (e.g. "My Site Social Stream") and enter the App contact email, then click "Next".
3. On the "Add use cases" screen, under "Filter by" select "Content management" then click "Manage messaging &amp; content on Instagram", then click "Next".
4. On the "Which business portfolio do you want to connect to this app?" screen select the last option for "I don't want to connect a business portfolio yet", then click "Next".
5. On the "Publishing requirements" screen click "Next".
6. On the "Overview" screen, click "Create App".

### 2. Customise the app's permissions

[](#2-customise-the-apps-permissions)

1. Click on the pencil icon from the menu on the left to get to the "Use cases" screen for your app.
2. You should see "Manage messaging &amp; content on Instagram", click on the "Customize" button next to it.
3. On the "Customize use case" screen click on "Permissions and features", then click "+ Add" next to "instagram\_business\_basic".
4. Then click Actions &gt; Remove for both "instagram\_business\_manage\_messages" and "instagram\_manage\_comments". The plugin doesn't use these permissions, and removing them avoids triggering Meta's App Review requirement for them.

### 3. Set up Instagram login

[](#3-set-up-instagram-login)

1. Click on "API setup with Instagram login", then note your **Instagram App ID** and **Instagram App Secret**.
2. Click on the "Roles" link, which will take you off to the App roles screen in a new browser tab, where...
    1. Click on the "Add People" button in the top right.
    2. Select "Instagram tester" under "Additional roles for this app".
    3. Enter the Instagram account username into the search field and select the account, click the "Add" button.
    4. Then login to that Instagram account and go to [https://www.instagram.com/accounts/manage\_access/](https://www.instagram.com/accounts/manage_access/) where you will need to approve the tester role.
    5. Return to the previous browser tab.
3. Under "2. Generate access tokens" expand the section by clicking on the down chevron, then click "Add account".
4. Sign in with the Instagram account you want to connect and complete Meta's prompts. You don't need to copy any token — the plugin will handle the token exchange when you click **Authorise** in the Craft CP (next section).
5. Under "4. Set up Instagram business login" click on the "Setup" button, then step through the wizard and add the following URL to the **OAuth redirect URIs** field: `https://your-site.com/actions/social-stream/auth/callback`. Replace "your-site.com" with your Craft installation's **primary site** domain (including "[www](http://www)." if your site uses it) — the plugin always uses the primary site's base URL for the callback, even on multi-site installs.

Plugin setup &amp; quick start
------------------------------

[](#plugin-setup--quick-start)

**Please note:**

- You can use environment variables for your **Instagram App ID** and **Instagram App Secret**, if so set those up now.
- These steps are best followed in your production environment.
- The plugin exchanges the authorisation code for a long-lived token (60-day validity) and stores it encrypted in the database. A masked preview of the token and its expiry date are shown in the Connection Status panel.

1. In Craft CMS navigate to "Social Stream" from the left hand menu
2. On the "Connection" tab enter your **Instagram App ID** and **Instagram App Secret** (or your environment variable names if you set them up), then click "Authorise".
3. You'll need to login to the Instagram account and approve the connection.
4. Review the settings on the "Configuration" tab.
5. On the "Stream Preview" tab click on "Load Stream Preview".

Meta App Review
---------------

[](#meta-app-review)

You can use the app in **Development Mode** with your own Instagram account added as a test user, this seems to work just fine.

---

Configuration
-------------

[](#configuration)

### CP Settings

[](#cp-settings)

Navigate to **Social Stream** in the CP sidebar. The settings page is organised into three tabs:

#### Connection Tab

[](#connection-tab)

SettingDescriptionDefaultInstagram App IDFrom the Meta Developer portal. Supports `$ENV_VAR` syntax.—Instagram App SecretFrom the Meta Developer portal. Supports `$ENV_VAR` syntax.—An **Authorise** button starts the OAuth flow to connect your Instagram account. Once connected, the Connection Health panel is displayed here (see below).

#### Configuration Tab

[](#configuration-tab)

SettingDescriptionDefaultDefault Post LimitNumber of posts to fetch (1-100).25Exclude Non-Feed PostsExclude posts not shared to the main feed (e.g. Reels-only).OffCache DurationHow long to cache stream data, in minutes.60#### API Tab

[](#api-tab)

SettingDescriptionDefaultSecure API EndpointEnable the optional JSON API endpoint.OffWhen enabled, a **Generate Token** button creates a bearer token for API access. The token is shown once and cannot be retrieved later.

### Config File Overrides

[](#config-file-overrides)

All CP settings can be overridden via `config/social-stream.php`:

```
