Quick Start
This guide will help you install and start using the Datto RMM API clients.
Prerequisites
Section titled “Prerequisites”For TypeScript Client
Section titled “For TypeScript Client”- Node.js v22 or higher (see
.nvmrc) - pnpm v9.14.2 or higher
For Rust Client
Section titled “For Rust Client”- Rust (latest stable)
- Cargo
For Development
Section titled “For Development”- Git
- All of the above
Installation
Section titled “Installation”TypeScript Client
Section titled “TypeScript Client”Install from the monorepo or add as a dependency:
pnpm add datto-rmm-apiRust Client
Section titled “Rust Client”Add to your Cargo.toml:
[dependencies]datto-api = { git = "https://github.com/josh-fisher/datto-rmm", path = "crates/datto-api" }tokio = { version = "1", features = ["rt-multi-thread", "macros"] }Getting API Credentials
Section titled “Getting API Credentials”- Log in to your Datto RMM portal
- Navigate to Setup > API
- Create a new API key pair
- Note your API Key and API Secret
TypeScript Usage
Section titled “TypeScript Usage”import { createDattoClient, Platform } from 'datto-rmm-api';
// Create a clientconst client = createDattoClient({ platform: Platform.MERLOT, // Choose your platform auth: { apiKey: process.env.DATTO_API_KEY!, apiSecret: process.env.DATTO_API_SECRET!, },});
// Make API callsconst { data, error } = await client.GET('/v2/account/devices');
if (error) { console.error('Error:', error);} else { console.log('Devices:', data?.devices);}Rust Usage
Section titled “Rust Usage”use datto_api::{DattoClient, Platform, Credentials};
#[tokio::main]async fn main() -> Result<(), Box<dyn std::error::Error>> { let client = DattoClient::new( Platform::Merlot, Credentials { api_key: std::env::var("DATTO_API_KEY")?, api_secret: std::env::var("DATTO_API_SECRET")?, }, ).await?;
println!("Connected to {}", client.platform()); Ok(())}Development Setup
Section titled “Development Setup”To work on the clients themselves:
# Clone the repositorygit clone https://github.com/josh-fisher/datto-rmm.gitcd datto-rmm
# Install dependenciespnpm install
# Sync the OpenAPI specpnpm sync:openapi
# Generate API clientspnpm generate:api
# Build everythingpnpm buildAvailable Commands
Section titled “Available Commands”| Command | Description |
|---|---|
pnpm install | Install dependencies |
pnpm build | Build all packages |
pnpm dev | Start development servers |
pnpm sync:openapi | Fetch latest OpenAPI spec |
pnpm generate:api | Regenerate API clients |
pnpm typecheck | Run TypeScript type checking |
pnpm lint | Check code quality |
pnpm test | Run tests |
Next Steps
Section titled “Next Steps”- Read the TypeScript Client documentation
- Check the Project Structure guide
- Explore the API Reference