TagoIO SDK for JavaScript and TypeScript
    Preparing search index...

    Class TagoTiP

    TagoTiP command client

    This class provides a convenient interface for sending commands to devices through TagoTiP. Unlike Services, which is configured with your analysis token, TagoTiP requires a Service Authorization token, so it is constructed with that token directly.

    import { TagoTiP } from "@tago-io/sdk";

    const tagoTiP = new TagoTiP({ token: "your-service-authorization-token" });

    await tagoTiP.cmd({
    serial: "mqtt1",
    protocol: "mqtt",
    body: "reboot",
    });
    import { Analysis, TagoTiP } from "@tago-io/sdk";

    async function startAnalysis(context) {
    const serviceAuthorizationToken = context.environment.find(
    (value) => value.key === "SERVICE_AUTHORIZATION"
    )?.value;

    if (!serviceAuthorizationToken) {
    throw "Missing 'SERVICE_AUTHORIZATION' environment";
    }

    const tagoTiP = new TagoTiP({ token: serviceAuthorizationToken });

    await tagoTiP
    .cmd({ serial: "mqtt1", protocol: "mqtt", body: "reboot" })
    .then(console.log)
    .catch(console.log);
    }

    Analysis.use(startAnalysis);
    Index

    Constructors

    Methods

    Constructors

    Methods