Skip to main content

Creating Capabilities

Once you have a self-hosted setup running on your dev machine and have installed the agent from your portal, you are ready to create and run your own capabilities. To ensure this is the case, verify that your device is showing up as online (green dot) on your portal.

Node.js

Before you proceed, make sure you have node.js 20+ installed. When the Transitive agent installs, it installs a copy of node.js 20 in ~/.transitive/usr/bin. If you like, you can add that folder to your PATH, or you can install node.js directly from https://deb.nodesource.com/.

To create a new capability, run:

npm init @transitive-sdk@latest mycap

where mycap is the name you want your new capability to have. This will create a new folder with the same name, containing a ready-to-go template of a Transitive capability. Run npm start inside that folder to start the new capability. This will:

  • start the robot component on your local machine
  • start the cloud component in a docker container
  • start esbuild to bundle the front-end

Once this has all started up, go back to the portal where you should now see the capability running on your device.

Next Steps

Once the three parts of the capability are running, i.e., the robot component, the cloud component, and the front-end component, you are ready to start editing the starter template and develop the capability you want. For this, we recommend you first learn about the MqttSync class in the SDK documentation. This class implements Transitive's live data synchronization between the three components (robot, cloud, and web UI).