todoist-nodejs

The unofficial Todoist Node.js API library

Usage no npm install needed!

<script type="module">
  import todoistNodejs from 'https://cdn.skypack.dev/todoist-nodejs';
</script>

README

todoist-nodejs

GitHub License Todoist API npm version

The unofficial Todoist Node.js API library. Use todoist SYNC API.

Installation

npm install node-todoist

or

yarn add node-todoist

Usage

To get started create new instance of todoist, pass it your API token and make sync to login.

const todoist = require('todoist-nodejs');

const api = new todoist(<TOKEN_API>);
api.sync();

After sync you can do everything you want. Some examples are below. Pay attention, that any changes first of all are placed in queue. So you should call commit method to sync it with todoist servers.

api.commit();

Examples

Performing a add item request

const todoist = require("../build/index");

const api = new todoist(process.env.TOKEN_API);
api
  .sync()
  .then(() =>
    api.items.add('task1', {
      priority: 4,
      due: {
        string: 'today'
      }
    })
  )
  .then(() => api.commit());

Development

  1. Clone repo and install dependencies.
npm install
  1. Create '.env' (.env.example is on the root of the repo) and insert your TOKEN_API.
  2. Build it:
npm run build

   Before every commit it will be rebuilded using pre-commit hook.

  1. Use examples to test your changes.

Contributing

Feel free to improve the code and implement new features.