Analysis is what allows you to create powerful applications on TagoIO. When creating analysis you have to choose between running it at TagoIO or External, which means that you will run on your machine.
You can choose to run the analysis on an external machine for a few reasons:
So, let's start with the instructions you need to get your analysis working in an external environment.
Node.js is a powerful and relatively new programing language developed using JavaScript. It is a non-blocking and event-driven language that has been adopted for several developers and companies to deal with data-intensive real-time applications. Learn more about node.js.
Open Node.js Installation Guide for instructions on how to install NPM and Node.js.
In order to start writing your code, you first must setup the environment with Node.JS and NPM.
2-1. Open your favorite command-line tool like the Windows Command Prompt, PowerShell, Cygwin, Bash or the Git shell (which is installed along with Github for Windows). Then create or navigate to your new project folder.
2-2. If the folder is empty, you must write in the command-line npm init and fill all prompted requests. If this is your first time, you can leave all default by just pressing enter.
2-3. Now you must install Tago sdk and TagoIO-Builder SDK. Enter in your command-line npm install --save @tago-io/sdk and npm install -g @tago-io/builder This will start the installation of the TagoIO SDK and the TagoIO-Builder if you wish to upload your script later at TagoIO.
After the code and the environment set, you only need to make sure you put the right Analysis token into your analysis file.
In order to do that, every analysis has the following line below. You must replace MY-ANALYSIS-TOKEN-HERE by your analysis token.
module.exports = new Analysis(myAnalysis, { token: 'MY-ANALYSIS-TOKEN-HERE' } );
Go back to Tago and click "Save and Run" or just "Run" to run your script. You can also configure an action to run your script automatically.
If you only want to run the scripts on your machine, this step is not required. But if you want to build powerful scripts to upload at TagoIO, with several folders, imports, and third-party packages, you must use the analysis-builder to compile the scripts.
To do that is simple, just enter your command line tool and follow these instructions:
You can check our analysis examples with the full environment already set up for you below:
Now you have everything you need to know about running analysis in your machine and can start to creating full applications and powerful analysis using TagoIO