Instagram plugin for PhoneGap/Cordova
Switch branches/tags
Clone or download
Pull request Compare This branch is 41 commits behind vstirbu:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Instagram plugin for Cordova

By Vlad Stirbu.

Adds ability to share the content of a canvas element or a dataUrl encoded image using the Instagram application for iOS and Android.

GitHub version Stories in Ready Join the chat at

Installing the plugin to your project

In your project directory:

cordova plugins add

Instagram plugin JavaScript API

Detect if the Instagram application is installed on the device. The function isInstalled accepts a callback function as parameter:

Instagram.isInstalled(function (err, installed) {
    if (installed) {
        console.log("Instagram is", installed); // installed app version on Android
    } else {
        console.log("Instagram is not installed");

Share the content of a canvas element or a base64 dataURL image. The function share accepts a string, corresponding to the canvas element id or the dataURL, an optional caption, and a callback function as parameters:

Instagram.share(canvasIdOrDataUrl, caption, function (err) {
    if (err) {
        console.log("not shared");
    } else {


Instagram.share(canvasIdOrDataUrl, function (err) {
    if (err) {
        console.log("not shared");
    } else {

A very basic application that uses the plugin can be found here.



  • Passing caption in addition to sharing image requires Instagram Android application version 6.1.0 or higher.
  • Older versions of Android (2.x-3.x) do not have proper support for toDataURL on canvas elements. You can still get the canvas content as dataURL following these instructions. Pass the dataUrl instead of the canvas id to share.


  • Althought the plugin follows the instructions to show only Instagram in the document interaction controller, there are reports that other apps appear in the list.


  • Sharing image when knowing the file url.


The plugin is available under MIT license.