dilame / instagram-private-api

NodeJS Instagram private API SDK. Written in TypeScript.
MIT License
5.99k stars 1.14k forks source link

Uncaught TypeError: Client.CookieMemoryStorage is not a constructor #72

Closed leandromatos closed 7 years ago

leandromatos commented 7 years ago

I try to use Cookie Memory Storage but not working.

What is wrong?

var Client = require('instagram-private-api').V1;
var device = new Client.Device('myusername');
var storage = new Client.CookieMemoryStorage();

// And go for login
Client.Session.create(device, storage, 'myusername', 'mypassword')
    .then(function(session) {
        // Now you have a session, we can follow / unfollow, anything...
        // And we want to follow Instagram official profile
        return [session, Client.Account.searchForUser(session, 'instagram')]
    })
    .spread(function(session, account) {
        return Client.Relationship.create(session, account.id);
    })
    .then(function(relationship) {
        console.log(relationship.params)
    // {followedBy: ... , following: ... }
    // Yey, you just followed @instagram
    })
drawrowfly commented 7 years ago

Because this function constructor is not available in package installed via npm

huttarichard commented 7 years ago

@leandromatos @glazkoman will publish soon

leandromatos commented 7 years ago

OK 👍