Skip to content
Demonstration scripts on how to use the API & SDK to set device tags from within your app.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Using the balena API & SDK to set device tags from within apps.

This is a simple project based on the balena simple-server-node repository that demonstrates how to set device tags from within your application.

This project serves up "Hello World!" on port :80 of your balena device and additionally:

  • sets the stats.laststart tag with the current timestamp when the application starts.
    • This is done using CURL in the application's
  • sets the stats.lastrequest tag with the current timestamp whenever the node server responds to an HTTP request.
    • This is done using the javascript balena-SDK in the application's server.js.


Check out the instructions in the balena simple-server-node repository to get started.


The scripts use the RESIN_API_KEY environment variable, which is injected to the environment of all balena applications, to authenticate all requests.

You can’t perform that action at this time.