Service abstractions for external integrations
This class provides convenient interfaces for integrating with external services commonly used in IoT applications, including messaging, notifications, file handling, and third-party platforms. All services are configured with your analysis token.
import { Services } from "@tago-io/sdk";const services = new Services({ token: "your-analysis-token" });await services.sms.send({ to: "+1234567890", message: "Alert: Temperature threshold exceeded!"}); Copy
import { Services } from "@tago-io/sdk";const services = new Services({ token: "your-analysis-token" });await services.sms.send({ to: "+1234567890", message: "Alert: Temperature threshold exceeded!"});
await services.email.send({ to: "user@example.com", subject: "IoT Report", message: "Please find the report attached.", attachment: services.attachment.create(pdfBuffer, "report.pdf")}); Copy
await services.email.send({ to: "user@example.com", subject: "IoT Report", message: "Please find the report attached.", attachment: services.attachment.create(pdfBuffer, "report.pdf")});
services.console.log("Processing data...");services.console.error("Failed to connect to sensor"); Copy
services.console.log("Processing data...");services.console.error("Failed to connect to sensor");
// Using static methods for one-off operationsawait Services.notification.send({ message: "System alert", title: "IoT Alert"}); Copy
// Using static methods for one-off operationsawait Services.notification.send({ message: "System alert", title: "IoT Alert"});
Optional
Static
Service abstractions for external integrations
This class provides convenient interfaces for integrating with external services commonly used in IoT applications, including messaging, notifications, file handling, and third-party platforms. All services are configured with your analysis token.
Example: SMS notifications
Example: Email with attachments
Example: Console logging (for analysis debugging)
Example: Static methods for quick access