The unofficial Todoist Node.js API library. Use todoist SYNC API.
npm install todoist-nodejs
or
yarn add todoist-nodejs
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());
- Clone repo and install dependencies.
npm install
- Create '.env' (.env.example is on the root of the repo) and insert your TOKEN_API.
- Build it:
npm run build
Β Β Β Before every commit it will be rebuilded using pre-commit hook.
- Use examples to test your changes.
Feel free to improve the code and implement new features.