Giter VIP home page Giter VIP logo

todoist-js's Introduction

OBSOLETE

Todoist V7 endpoint is deprecated

No Maintenance Intended

todoist-js NPM version

The (un)official Todoist javascript API library

A javascript client for Todoist Sync API with full support of endpoint resources. This is an adaptation from Todoist official Python lib.

How to start

install the package npm install todoist-js --save into your project

Usage

import the API

import TodoistAPI from 'todoist-js'

Create an instance providing an access token (how to get an access token?)

const todoist = new TodoistAPI('xxxxxxxxxx');

Get productivity stats

todoist.completed.get_stats().then(stats => {
  console.log(stats.karma_trend);
});

๐Ÿš€ You can see full list of capabilities in action into tests folder

Try out the lib by cloning this Runkit notebook

Implementation opportunities

  • Web apps or sites integration.
  • Web plugins for content managers like Wordpress, Joomla, etc.
  • Browsers add-ons.
  • Mobile world with hybrid apps frameworks like react-native, Ionic and others.
  • Node.js on server side and universal javascript apps.
  • Web components for libs like Reactjs, Angular and more.
  • Integration with desktop applications, applets, widgets and all those that support javascript.
  • Can you think of any other?

Documentation

Official API Docs for developers

What's next

  • Implement a demo app using this library.โœ… : this is Asist, it can autenticate, sync, fetch and complete tasks for Todoist.
  • Implement a web oAuth2 process and document it.โœ… : OAuth process
  • Test browsers compatibility.
  • Test compatibility with Node.

Development / Testing

Clone this repo git clone [email protected]:Cosmitar/todoist-js.git.

This repo includes a Jest suite of tests, used for TDD. Before start, make sure you create a .env file (you can use .env-example as template) and complete, as minimum requirement, the variable ACCESS_TOKEN with a valid user access token (how to get an access token?). Then, install all dev dependencies by running npm install

โŒ Do not run all tests together with npm run test or you'll get a max request limit per seconds error.

Run each suite independently like:

npm run test -t api.spec.js

npm run test -t completed.spec.js

npm run test -t filter.spec.js and so on.

โ— Some tests can fail due to restrictions in your account if you're not premium.

If you want to test share.spec.js you need first to include a 2nd access token (from a different user) into .env file, using variable ALTERNATIVE_ACCOUNT_ACCESS_TOKEN

Contributing

Pull requests and issues are welcome. If you've found a bug, please open an issue.

License

MIT

todoist-js's People

Contributors

cosmitar avatar kandros avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

todoist-js's Issues

410 Gone

i have been using this library for the past few months and it seems, todoist have updated their api.
will this be updated as-well? or deprecated?

How do you know what options there are?

I am building a wish list app and wanted to use a todo app as my data. (first tried Wunderlist, but because Microsoft bought it, it is now death. Let's hope they don't do the same thing with this platform)

I found your demo project and am spitting that one out to see what you use. I found changing .completed.get_stats() to .query(['today']) gets me all items in the Today view. This helped me find my list ID (wish list ID, which is 2187923865) and now I want to query only that list, but I don't see any options.

Is there a list of all the possible options. The default Todoist API is no help either.

Typescript support?

It would be great to get TypeDefs for this so that it's easier to consume in a Typescript project.

Access-Control-Allow-Origin is invalid when using this in the browser

This library works fine on the server but when I try to make the same API requests (e.g. todoist.sync(), I get the following error:

Failed to load https://todoist.com/API/v7/sync?day_orders_timestamp=&include_notification_settings=1&resource_types=%5B%22all%22%5D&commands=%5B%5D&token=token&sync_token=*: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://localhost:8080' is therefore not allowed access.

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.