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 🙏

© 2024 – Pkg Stats / Ryan Hefner

instafeed.js

v2.0.0

Published

A simple Instagram javascript plugin for your website.

Downloads

7,306

Readme

Instafeed.js

Build Status npm version

Instafeed.js is a simple way to display your Instagram photos on your website.

Version 2 of Instafeed.js is now available, powered by the new Instagram Basic Display API.

For help upgrading from v1, see the v2 migration guide.

Installation

Setting up Instafeed is pretty straight-forward - there are 3 main steps.

  1. Create a Facebook app linked to Instagram, and add yourself as a test user. See Managing User Tokens.
  2. Create an access token and provide it to an Instagram Token service
  3. Add the instafeed.js script to your web page and provide some simple options. See Basic Usage
<script type="text/javascript" src="path/to/instafeed.min.js"></script>

Note: Instafeed.js is also compatible with require.js and commonJS exports

Basic Usage

<div id="instafeed"></div>

<script type="text/javascript">
    var feed = new Instafeed({
      accessToken: 'your-token'
    });
    feed.run();
</script>

Instafeed will automatically look for a <div id="instafeed"></div> and fill it with linked thumbnails. Of course, you can easily change this behavior using standard options. Also check out the advanced options for some advanced ways of customizing Instafeed.js.

Requirements

  • A Facebook developer account, and an Instagram account with some media posted to it.
  • A Facebook app linked to your Instagram account, and a token generated through that app.
  • A service to keep your access token fresh

Options

Here are some of the most commonly used options:

| Key | Default Value | Valid types | Description | |---|---|---|---| | accessToken | null | String, Function | Required. The Instagram access token, either as a string, or a function which returns a string | | debug | false | Boolean | Set to true to display debugging information | | filter | null | Function | A function used to exclude images from your results. The function will be given the image data as an argument, and expects the function to return a boolean. | | limit | null | Number | Display a maximum of this many posts | | sort | null | Function | A custom function to sort the media, rather than the default 'most recent' sorting| | target | 'instafeed' | String, DOM Element | Either the ID or the DOM element itself where you want to add the images. | | template | '<a href="{{link}}"><img title="{{caption}}" src="{{image}}" /></a>' | String | A mustache template used to produce HTML for the document. | | transform | null | Function | A function used to transform the image data before it is rendered. |

See Options in the wiki for the complete reference.

Templating

The easiest way to control the way Instafeed.js looks on your website is to use the template option. You can write your own HTML markup and it will be used for every image that Instafeed.js fetches. See Templating.

Changelog

See CHANGELOG.md.