🎉 Cmdop v1.0 is here! Download now →
Skip to Content
DocsSDKInstallation

Installation

Node.js / npm

npm install @cmdop/sdk

pnpm

pnpm add @cmdop/sdk

Yarn

yarn add @cmdop/sdk

React

For React applications:

npm install @cmdop/react

This includes @cmdop/sdk as a dependency.

Requirements

  • Node.js 18.0 or later
  • TypeScript 5.0+ (recommended)

API Key

Get your API key from dashboard settings .

Environment Variable

export CMDOP_API_KEY=your-api-key

In Code

import { Cmdop } from '@cmdop/sdk'; const client = new Cmdop({ apiKey: process.env.CMDOP_API_KEY, });

TypeScript

Full TypeScript support out of the box:

import { Cmdop, Machine, Command } from '@cmdop/sdk'; const client = new Cmdop({ apiKey: '...' }); // Fully typed responses const machines: Machine[] = await client.machines.list();

Browser Usage

The SDK works in browsers with bundlers:

// Next.js, Vite, etc. import { Cmdop } from '@cmdop/sdk';

Note: Never expose your API key in client-side code. Use environment variables or a backend proxy.

Verify Installation

import { Cmdop } from '@cmdop/sdk'; const client = new Cmdop({ apiKey: '...' }); const me = await client.auth.me(); console.log('Authenticated as:', me.email);

SDK Installation | Cmdop