Write control code with Viam SDKs

The Viam SDKs are libraries for writing your own code that controls machines and talks to the Viam cloud. They share the same resource and method model, so what you learn in one carries over to the others. Pick the one that fits where your code runs and what you are building.

  • To write a module, use Python, Go, or C++.
  • To build a backend application or script, use Python, Go, or TypeScript (Node.js).
  • To build a web app, use TypeScript.
  • To build a mobile or desktop app, or a multi-platform app from one codebase, use Flutter.

Choose an SDK

SDKRunsSetupReference docs
PythonBackend, or as a modulePython setuppython.viam.dev
GoBackend, or as a moduleGo setuppkg.go.dev
TypeScriptWeb and Node.jsWeb app setup for the browser, Node.js setup for Node.jsts.viam.dev
FlutterMobile, desktop, webFlutter setupflutter.viam.dev
C++Backend, or as a moduleC++ setup (source build or Conan)cpp.viam.dev

If your team already has a React Native codebase, see React Native setup. For new mobile projects, use Flutter. Flutter also builds for the web, with the same limitations as other Flutter web apps. If a web app is your only target, TypeScript is the better fit.

Write a module

Modules add hardware drivers and logic to a machine, and they run on the machine itself. Start from viam module generate and follow Build and deploy modules. The generated project handles setup and passes in the resources your module depends on, so you don’t need the app setup pages above. The SDK’s resources and method signatures are the same in modules and in apps, so the reference docs apply to both.

A module that calls the Viam cloud APIs gets its credentials from the module’s environment variables, which viam-server sets. See Access platform APIs from within a module. A module that controls a different machine needs an address and API key the way an app does, so follow the setup page for your language.

What you can do with the SDKs

  • Control components and services on a machine.
  • Manage your fleet, data, and billing information, or provision machines. The C++ SDK covers machine control and the data client, but has no fleet, billing, or provisioning client, and it doesn’t include every service, such as vision.
  • Create custom modular resources in Python, Go, or C++.

Next steps