todoist-app

1.0.5 • Public • Published

Install

npm i -save todoist-app

Usage

Need to create the Todoist by passing clientId, clientSecret from Todoist Developers Page

then also need to provide the scope if no scope has been provided then the default read scope will applied

var TodoistAuth = require('todoist-app').TodoistAuth;
var todoist = new TodoistAuth({
    clientId:clientID,
    clientSecret:clientSecret,
    scope:scope
});

calling getAuthUrl with state you will get the auth url

var authUrl = todoist.getAuthUrl('secretString');

Get the Access Token by calling the getToken with code

var data = {};
data.code = code;
data.state = state;
todoist.getToken(data, (err, data)=>{
        if(err){
            console.log("Error while retriving token")
            res.status(501).json({
                status:'failure',
                message:"Cannot get the user token"
            });
        }
        console.log("Token retrived successfully");
        var response = {};
        response.status = "success";
        response.message = "User token has been received";
        res.status(200).json(response);
    });
 

TODO

License

MIT

Package Sidebar

Install

npm i todoist-app

Weekly Downloads

6

Version

1.0.5

License

ISC

Last publish

Collaborators

  • robinmano