GithubHelp home page GithubHelp logo

weisjohn / google-contacts-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from olalonde/google-contacts

5.0 3.0 5.0 27 KB

Node.js wrapper for the Google Contacts API (uses OAuth 2.0 token authentication)

License: MIT License

JavaScript 100.00%

google-contacts-api's Introduction

Node.js wrapper for the Google Contacts API.

install

npm install google-contacts-api

usage

var GoogleContacts = require('google-contacts-api');
var contacts = new GoogleContacts({ token : req.token });
contacts.getContacts(function(err, contacts) {
    // ...
});

Refresh Your Token

var GoogleContacts = require('google-contacts-api');
var contacts = new GoogleContacts();
contacts.refreshAccessToken(req.refreshToken , function(err, function(err,newToken)) {
    // ...
});

test

To test this module, $GOOGLE_API_TOKEN must be set.

$ export GOOGLE_API_TOKEN="ya29.WDVMYoReyJOKac3AFWMDg6lfMv8jyilWpjtQBqL99IKuiWTInpEqZFDi"
$ npm test

google-contacts-api's People

Contributors

weisjohn avatar ajnasz avatar olalonde avatar hamdipro avatar

Stargazers

Mateus de Oliveira avatar  avatar  avatar Xavier Baldacci avatar flyeven avatar

Watchers

 avatar James Cloos avatar  avatar

google-contacts-api's Issues

Error: Bad client request status: 401

I think I'm not using the right token or something like that. In passport-google, I have token and refreshToken. I'm saving token on my database and trying to retrieve it back when I want to access google contacts. Well, Not exactly sure where I can fix something.

Error: Cannot call method 'forEach' of undefined

I see this error every once in a while in my logs. It would be nice if it threw a more helpful error instead.

Cannot call method 'forEach' of undefined
    GoogleContacts.GoogleContacts._saveContactsFromFeed in /app/node_modules/google-contacts-api/index.js:211
    Object.receivedContacts in /app/node_modules/google-contacts-api/index.js:105
    IncomingMessage.[anonymous] in /app/node_modules/google-contacts-api/index.js:76

Any example with passport in node to get the contacts

I am using passport google strategies for authentication and tried to fetch the contacts using this package. But no luck. it will be great if you can help, in this regard. Any example will be much appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.