npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

datto-rmm-api

v0.1.0

Published

Auto-generated TypeScript client for the Datto RMM API

Readme

datto-rmm-api

Auto-generated TypeScript client for the Datto RMM API.

Installation

pnpm add datto-rmm-api

Quick Start

import { createDattoClient, Platform } from 'datto-rmm-api';

// Create a client with OAuth credentials
const client = createDattoClient({
  platform: Platform.MERLOT,
  auth: {
    apiKey: process.env.DATTO_API_KEY!,
    apiSecret: process.env.DATTO_API_SECRET!,
  },
});

// Make typed API calls
const { data, error } = await client.GET('/v2/account/devices');

if (error) {
  console.error('API error:', error);
} else {
  console.log('Devices:', data);
}

Platforms

The Datto RMM API is hosted on multiple regional platforms. All platforms share the same API schema.

import { Platform } from 'datto-rmm-api';

// Available platforms
Platform.PINOTAGE  // https://pinotage-api.centrastage.net/api
Platform.MERLOT    // https://merlot-api.centrastage.net/api
Platform.CONCORD   // https://concord-api.centrastage.net/api
Platform.VIDAL     // https://vidal-api.centrastage.net/api
Platform.ZINFANDEL // https://zinfandel-api.centrastage.net/api
Platform.SYRAH     // https://syrah-api.centrastage.net/api

Authentication

OAuth Credentials (Recommended)

Provide your API key and secret, and the client will automatically manage token refresh:

const client = createDattoClient({
  platform: Platform.MERLOT,
  auth: {
    apiKey: 'your-api-key',
    apiSecret: 'your-api-secret',
  },
});

Custom Token Provider

For more control over token management, provide a custom getToken function:

const client = createDattoClient({
  platform: Platform.MERLOT,
  auth: {
    getToken: async () => {
      // Return your token from wherever you store it
      return myTokenStore.getToken();
    },
  },
});

API Usage

The client provides fully typed methods for all API endpoints. Use your IDE's autocomplete to explore available paths:

// Get account devices
const { data: devices } = await client.GET('/v2/account/devices');

// Get a specific device
const { data: device } = await client.GET('/v2/device/{deviceUid}', {
  params: { path: { deviceUid: 'device-123' } },
});

// Get device alerts
const { data: alerts } = await client.GET('/v2/device/{deviceUid}/alerts/open', {
  params: { path: { deviceUid: 'device-123' } },
});

// Resolve an alert
const { data } = await client.POST('/v2/alert/{alertUid}/resolve', {
  params: { path: { alertUid: 'alert-456' } },
});

// Create a quick job
const { data: job } = await client.PUT('/v2/device/{deviceUid}/quickjob', {
  params: { path: { deviceUid: 'device-123' } },
  body: {
    jobName: 'My Quick Job',
    componentUid: 'component-789',
    variables: {},
  },
});

Middleware

Add custom middleware for logging, error handling, or other cross-cutting concerns:

import { createDattoClient, Platform } from 'datto-rmm-api';

const client = createDattoClient({
  platform: Platform.MERLOT,
  auth: { apiKey: '...', apiSecret: '...' },
  middleware: [
    {
      onRequest({ request }) {
        console.log('Request:', request.method, request.url);
        return request;
      },
      onResponse({ response }) {
        console.log('Response:', response.status);
        return response;
      },
    },
  ],
});

Type Exports

All API types are exported for use in your application:

import type { components, paths } from 'datto-rmm-api/types';

// Use schema types
type Device = components['schemas']['Device'];
type Alert = components['schemas']['Alert'];
type Site = components['schemas']['Site'];

// Use path types for custom type guards
type DevicesResponse = paths['/v2/account/devices']['get']['responses']['200']['content']['application/json'];

Regenerating Types

If the Datto RMM API is updated, regenerate the types:

# Sync the latest OpenAPI spec
pnpm sync:openapi

# Regenerate clients
pnpm generate:api

License

MIT