Home

Awesome

Minigram

A simple plugin to display your latest Instagram photos with Vanilla JS

Demo

View demo here

Install

With npm

npm install minigram --save

Download

You can download the latest version or checkout all the releases here.

How to use?

Require the package or use the global Minigram namespace:

AMD

<script>
require(["path/to/minigram.js"], function(Minigram) {
    // Code here
});
</script>

commonJS

var Minigram = require('Minigram');

ES6

import Minigram from 'Minigram';

Browser

<script src="path/to/minigram.js"></script>

Basic Usage

See how easy it is to obtain images of a profile:

<script>
    new Minigram(target, {
        counter: 8,
        resolution: 'low',
        token: 'YOUR_TOKEN_HERE',
        html: '<li class="instagram-thumbnail"><a class="instagram-placeholder" href="{url}" target="_blank"><img src="{image}" alt="{caption}"></a></li>'
    });
</script>

Requirements

The only thing you'll need to get going is a valid access token from Instagram's API. You can easily register for one on Instagram's website.

Options

Templating

The easiest way to control the way minigram.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 minigram.js fetches.

Here's a quick example:

<script>
    new Minigram(target, {
        counter: 8,
        resolution: 'low',
        token: 'YOUR_TOKEN_HERE',
        html: '<a href="{url}"><img src="{image}" alt="{caption}"></a>'
    });
</script>

Notice the {url}, {image} and {caption}? The templating option provides several tags for you to use to control where variables are inserted into your HTML markup. Available keywors are:

Browser Support

IEChromeFirefoxOperaSafari
IE 9+ ✔Latest ✔Latest ✔Latest ✔Latest ✔

Contributing

Check CONTRIBUTING.md for more information.

History

Check Releases for detailed changelog.

License

MIT