Easiest way to get data from TNN via a javascript API (trying unsuccessfully with Node RED

Node-Red can connect direct to TTN via MQTT, Just search and read a bit on the forum, lots of information.

https://www.thethingsindustries.com/docs/integrations/node-red/

The first part is a bit old but read the entire thread.