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
| SDK | Runs | Setup | Reference docs |
|---|---|---|---|
| Python | Backend, or as a module | Python setup | python.viam.dev |
| Go | Backend, or as a module | Go setup | pkg.go.dev |
| TypeScript | Web and Node.js | Web app setup for the browser, Node.js setup for Node.js | ts.viam.dev |
| Flutter | Mobile, desktop, web | Flutter setup | flutter.viam.dev |
| C++ | Backend, or as a module | C++ 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
- App scaffolding: the steps every app follows, whatever the language.
- Connect to a machine: the connection patterns your code will use.
- Control components: call methods on a machine’s resources.
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!