Analysis execution context for TagoIO
This class provides the runtime environment for executing analysis scripts in TagoIO. It manages environment variables, console outputs, and analysis execution lifecycle. Analyses can run locally for development or in the TagoIO cloud platform.
import { Analysis } from "@tago-io/sdk";const analysis = new Analysis(async (context, scope) => { // Get analysis environment variables const environment = await context.getEnvironment(); // Use console service for logging context.console.log("Analysis started"); // Your analysis logic here console.log("Processing data...");}, { token: "your-analysis-token" }); Copy
import { Analysis } from "@tago-io/sdk";const analysis = new Analysis(async (context, scope) => { // Get analysis environment variables const environment = await context.getEnvironment(); // Use console service for logging context.console.log("Analysis started"); // Your analysis logic here console.log("Processing data...");}, { token: "your-analysis-token" });
const analysis = new Analysis(async (context) => { const env = await context.getEnvironment(); const apiKey = env.find(e => e.key === "API_KEY")?.value;}); Copy
const analysis = new Analysis(async (context) => { const env = await context.getEnvironment(); const apiKey = env.find(e => e.key === "API_KEY")?.value;});
const analysis = new Analysis(myAnalysisFunction, { token: "token", autostart: false});// Start analysis manuallyanalysis.start(); Copy
const analysis = new Analysis(myAnalysisFunction, { token: "token", autostart: false});// Start analysis manuallyanalysis.start();
Static
Optional
Analysis execution context for TagoIO
This class provides the runtime environment for executing analysis scripts in TagoIO. It manages environment variables, console outputs, and analysis execution lifecycle. Analyses can run locally for development or in the TagoIO cloud platform.
Example: Basic analysis usage
Example: Environment variables
Example: Manual start control