Dynalist-js // A Node.JS client for the Dynalist API

Hello everyone.

(Not sure if this belongs here or in the Developer category. Feel free to move around. Thanks!)

To scratch my own itch I built a simple API client module for Node.JS. Today I released it as dynalist-js on GitHub.

As usual it can be installed with npm install dynalist-js. A simple example:

const Client = require('dynalist-js');

const dyn = new Client('<my developer api token>');

dyn.editDocument('<my file id>', [{
    action: 'insert',
    parent_id: 'root',
    checkbox: true,
    content: 'Get more coffee'
}]).then(function(response) {
    console.log(response._success ? 'Done!' : 'Something went wrong');
});

It provides simple methods for almost all API endpoints (query and modify your file list, query and modify document contents, send to inbox, etc), plus a few utility methods for working with nodes or generating URLs. The README is currently the only documentation. Iā€™m hoping to expand that and also provide some example scripts as a starting point.

(Please note that I wrote this purely for server-side Node.JS usage. I frankly have no idea if it would work when executed in a browser environment.)

Personally I currently use the client to periodically generate a ā€œproject reportā€ that pulls data from my work document and presents it as a list of currently relevant information. I also generate a ā€œworld reportā€ where I pull information from other APIs and write information to a Dynalist document as a sort of dashboard.
(Aside: Iā€™m running these updates as GitHub Actions every few hours, so this is basically ā€œserverlessā€.)

I hope this interests some of you and Iā€™m looking forward to your feedback.

Take care,

_Lasar

3 Likes

Dude your rock!

I will look at your documentation and let you know if I have any questions.

This is sadly way beyond my skills, yet the things you talk about here are the things I would like to have myself in Dynalist (Reports and summaries).

Where do you suggest I start to be able to replicate what you are able to do. (I know CSS, HTML and webhosting but not much more).

1 Like

I honestly donā€˜t know what the best way to learn Node.js would be, but a quick googling turns up a lot of beginnerā€˜s tutorials.

I think you need a good grasp of the basic programming building blocks (variables, functions, objects, control structures like loops etc) and how to use those in JS.

Then youā€˜d go and use the API client to fetch your source document(s), extract and modify the information you want, then ise the client again to write to your report document.

I donā€˜t have any shareable code right now, but if you have issues integrating the client, Iā€˜d be happy to help.

1 Like

Ok. That luckily sounds a little like bash scripting so there might be a light in the tunnel here for me.