This is a fork of an incomplete library, you probably want @moranje/todoist-rest-api
The unofficial Todoist Node.js API library. Use todoist SYNC API.
npm install node-todoist
or
yarn add node-todoist
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();
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());
npm install
npm run build
Before every commit it will be rebuilded using pre-commit hook.
Feel free to improve the code and implement new features.