Magento 2 Instagram FeedsMagento 2 Instagram Feeds
Live Demo
Buy Now
Support
Live Demo
Buy Now
Support
  • Getting Started

    • Introduction
    • Requirements
    • Installation
  • Connect Instagram

    • Create a Meta App
    • Connect an Account
  • Build Your Feed

    • General Settings
    • Feed Management
    • Design & Layout
    • Placement & Widgets
    • Common Setups
  • Content

    • Media Library
    • Shoppable Posts
    • Product Gallery
    • Storefront Display
    • Analytics
  • Operations

    • Feed Sync & Cron
    • Upgrade
    • Uninstall
  • Extending

    • For Developers
  • Help

    • Troubleshooting
    • FAQ
    • Glossary
    • Known Limitations
    • Contact Support

For developers

Everything here is public API you can rely on, or an extension point built for customisation.

Service contracts

Webkul\InstagramFeed\Api\ holds the contracts; all are @api.

InterfaceUse it for
AccountRepositoryInterfaceConnected accounts
MediaRepositoryInterfacePosts
FeedRepositoryInterfaceFeeds and their store scope
MediaProductRepositoryInterfaceProduct tags
StatRepositoryInterfaceAnalytics rows
ProductGalleryAssignmentManagementInterfaceAttaching and detaching posts on a product's media gallery

Each supports save, getById, delete, deleteById and getList(SearchCriteriaInterface), plus a few domain finders such as getActiveForStore(int $storeId) and getPendingMirror(int $limit).

The Api\Data\* entity interfaces extend ExtensibleDataInterface, so you can add extension attributes without touching module code.

Rendering a feed yourself

Model\Feed\FeedDataProvider is the single contract every renderer reads from. It returns a plain DTO tree — no models, no products, no prices — which is what keeps the storefront block cacheable.

public function __construct(
    private readonly \Webkul\InstagramFeed\Model\Feed\FeedDataProvider $feedDataProvider
) {
}

$feed = $this->feedDataProvider->getByCode('homepage_feed', $storeId);

foreach ($feed?->getItems() ?? [] as $media) {
    $media->getUrl();
    $media->getAlt();
    $media->getPermalink();
    $media->getProductCount();
}

Use this for a custom theme, a Hyvä port, an AMP page or a GraphQL resolver.

Swapping behaviour with di.xml

ReplaceTo change
Model\Feed\ReviewProviderInterfaceWhere star ratings in popups come from
Model\Connection\TokenProviderInterfaceHow tokens are obtained and refreshed
Model\Feed\SettingsFactoryThe settings reader, if you add your own keys
Model\Feed\ProductAvailabilityThe rule deciding which products are shoppable

Example — your own review source:

<preference for="Webkul\InstagramFeed\Model\Feed\ReviewProviderInterface"
            type="Vendor\Module\Model\YourReviewProvider"/>

Storefront JavaScript

RequireJS modules under Webkul_InstagramFeed/js/:

ModuleResponsibility
feedSlider, tile clicks, batched reveal, lazy video
popupThe dialog, focus management, carousel
product-cardsFetching and rendering product cards
drag-scrollShared click-and-drag horizontal scrolling
insightsBatched analytics

The feed container dispatches DOM events you can listen to:

container.addEventListener('instagramfeed:tile-click', (e) => e.detail.mediaId);
container.addEventListener('instagramfeed:popup-open', (e) => e.detail.mediaId);
container.addEventListener('instagramfeed:product-click', (e) => e.detail.productId);
container.addEventListener('instagramfeed:add-to-cart', (e) => e.detail.productId);

The container also gains the class instagramfeed--ready once handlers are attached — useful for tests and for CSS that should apply only when enhanced.

Data model

TableHolds
wk_instagram_accountConnected accounts, tokens encrypted
wk_instagram_mediaPosts, moderation state, mirror state
wk_instagram_media_childCarousel slides
wk_instagram_feedFeeds and their settings blob
wk_instagram_feed_storeStore-view scope
wk_instagram_feed_sourceWhich accounts/hashtags feed a feed
wk_instagram_feed_mediaManual curation and ordering
wk_instagram_media_productProduct tags and hotspots
wk_instagram_media_categoryCategory links
wk_instagram_statDaily analytics rows
wk_instagram_sync_logSync history
wk_instagram_hashtagTracked hashtags — populated by the schema, not yet driven by any admin screen

Deletes cascade: removing an account removes its posts; removing a feed removes its sources and curation.

Queue topics

wk.instagram.account.sync, wk.instagram.media.mirror, wk.instagram.stats.ingest — see Model\Queue\Topic for the constants.

Content Security Policy

etc/csp_whitelist.xml allows *.cdninstagram.com and *.fbcdn.net for images and media. If you proxy Instagram media through your own CDN, add that host in your own whitelist.

See also

  • Known Limitations — what is deliberately absent, and why
  • Design & Layout — the CSS custom properties the templates emit
Prev
Uninstall
Next
Troubleshooting