node package manager
It’s your turn. Help us improve JavaScript. Take the 2017 JavaScript Ecosystem Survey »


facebook gif ads

Convert a list of image urls to an animated GIF slideshow ready to post to your Facebook page etc.

Example Post on Facebook:


npm install facebook-gif-ads --save


Rename index.example.js to index.js in the config folder and past in your individual Facebook access token.


Create GIF slideshow from example urls

// Load Dependencies 
var FbGifAds = require('facebook-gif-ads');
var config = require('config');
// Initialization 
var fbGifAds = new FbGifAds(config.facebook.access_token);
// Example urls 
var urls = [
var filename = "slideshow.gif";
fbGifAds.createSlideshow(urls, filename, function() {
    console.log(filename + " created.");

Post GIF image url to your Facebook page

var imageUrl = "";
var pageId = "1544219729194326";
fbGifAds.postToFB(pageId, imageUrl, function(err, postId) {
    if (err) {
        console.log("An error occured: ", err);
    } else {
        console.log("Image uploaded. Post ID: ", postId);


npm test

Useful Links

Facebook for business: Can I boost a post with an animated GIF?