npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

payload-instagram-plugin

v0.2.2

Published

Instagram plugin for Payload CMS

Readme

Payload Instagram Plugin

This plugin allows you to use an Instagram connected feed as content to be shown inside a Payload CMS blog.

Important: Starting from 0.0.8, the access token is stored in the database and refreshes automatically. The token refreshes every 10 days and is valid for 60 days.

Requirements

  • Instagram Business or Creator account — a personal Instagram account will not work. See the Setup Guide for how to convert your account (free, reversible).
  • Meta Developer App with Instagram product configured.
  • HTTPS — Instagram requires HTTPS for OAuth redirects, even on localhost.

How to setup

Follow the Setup Guide for detailed step-by-step instructions covering:

  1. Converting your Instagram account to Business/Creator
  2. Creating and configuring a Meta Developer App
  3. Installing and authorizing the plugin

Quick summary:

Set your redirect URI in the Meta Developer App to:

https://yourBaseUrl/api/instagram/authorize

Replace yourBaseUrl with your app URL. If running locally, use --experimental-https to start your dev server with HTTPS.

Also set:

  • Revoke authorization URL: https://yourBaseUrl/api/instagram/unauthorize
  • Data deletion request URL: https://yourBaseUrl/api/instagram/delete

Add the plugin to your payload.config.ts:

import { instagramPlugin } from 'instagram-payload-plugin'

export default buildConfig({
  plugins: [
    instagramPlugin({ enabled: true })
  ],
})

How to use

In the admin view, a new collection called instagram-posts is added. Do not add items to this collection manually!

A custom view called Instagram Posts is added to the left panel, allowing you to preview all connected Instagram posts. From here you can click on any post to add it to the collection.

Item types

The items in the collection have this structure:

type PostType = {
  id: string
  media_url: string
  permalink: string
  media_type: 'IMAGE' | 'VIDEO' | 'CAROUSEL_ALBUM'
  caption: string
  children?: {
    id: string
    media_url: string
    permalink: string
    media_type: string
  }[]
}

Type CAROUSEL_ALBUM will have an additional array of children, each being the actual image of the carousel (i.e. more than one image in a post).

How to import items into the page

Method 1: instagram-posts is a regular Payload collection, so you can query it like any other:

import configPromise from '@payload-config'
import { getPayload } from 'payload'

const payload = await getPayload({ config: configPromise })

const { docs } = await payload.find({
  collection: 'instagram-posts',
  depth: 3,
})

Method 2: Create a relationship block:

const InstagramIntegration: Block = {
  slug: 'InstagramIntegration',
  interfaceName: 'InstagramIntegrationBlock',
  fields: [
    {
      name: 'instagramSrc',
      type: 'relationship',
      required: true,
      relationTo: 'instagram-posts',
    },
  ],
}

Then use the component data:

const InstagramIntegration = ({ instagramSrc }: { instagramSrc: PostType }) => {
  const { media_type, media_url, caption, children } = instagramSrc
  return (
    <section className="relative flex">
      <Container>
        {media_type === 'CAROUSEL_ALBUM' && (
          <Carousel>
            <CarouselContent>
              {children?.map(({ media_url }) => (
                <CarouselItem key={media_url}>
                  <div className="relative h-[400px] w-full">
                    <Image layout="fill" objectFit="contain" src={media_url || ''} alt="carousel image" />
                  </div>
                </CarouselItem>
              ))}
            </CarouselContent>
            <CarouselPrevious />
            <CarouselNext />
          </Carousel>
        )}
        {caption && (
          <div className="w-full p-6 dark:text-zinc-100">
            <p>{caption}</p>
          </div>
        )}
      </Container>
    </section>
  )
}

How to delete an item

To delete an item, simply delete the entry from the collection view.