Registry / crm / connectwise-rest

connectwise-rest

JSON →
library2.0.0-alpha.2jsnpmunverified

A TypeScript-first Node.js module for interacting with ConnectWise Manage and Automate REST APIs. The current stable version is 2.0.0-alpha.2, targeting Node >=18, and releasing alpha pre-releases. It provides full type coverage, automatic pagination, retries, and logging. Key differentiators: supports both Manage and Automate APIs, handles file uploads/downloads, and offers typed endpoints for all operations.

npm install connectwise-rest
INSTALL
IMPORT
SIG · CONNECTWISE-REST
C
connectwise-rest
crmjavascriptv2.0.0-alpha.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ManageAPI
import { ManageAPI } from 'connectwise-rest'
const ManageAPI = require('connectwise-rest').ManageAPI
ESM import is preferred. CommonJS require still works but must destructure.
AutomateAPI
import { AutomateAPI } from 'connectwise-rest'
import AutomateAPI from 'connectwise-rest'
AutomateAPI is a named export, not default.
ConnectWiseManage
import { ConnectWiseManage } from 'connectwise-rest'
Deprecated alias for ManageAPI. Prefer ManageAPI.

Initializes ManageAPI with env credentials and fetches a ticket by ID, demonstrating async usage.

import { ManageAPI } from 'connectwise-rest'; const cwm = new ManageAPI({ companyId: process.env.CW_COMPANY_ID ?? '', companyUrl: process.env.CW_COMPANY_URL ?? '', publicKey: process.env.CW_PUBLIC_KEY ?? '', privateKey: process.env.CW_PRIVATE_KEY ?? '', clientId: process.env.CW_CLIENT_ID ?? '', }); cwm.ServiceDeskAPI.Tickets.getTicketById(1234) .then((ticket) => { console.log(ticket); }) .catch((error) => { console.error(error); });
Debug
Known issues
breakingVersion 2.0 regenerated Automate surface from new swagger spec, causing class renames.
fix
Consult CHANGELOG.md for rename mapping.
affects: >=2.0.0-alpha.2
breakingNode >=18 required starting from v2.0.0-alpha.2.
fix
Upgrade Node.js to v18 or later.
affects: >=2.0.0-alpha.2
gotchaManageAPI constructor expects companyUrl without protocol; 'your.connectwise.com' not 'https://...'.
fix
Pass only the hostname, e.g., 'your.connectwise.com'.
affects: *
gotchaRetry is disabled by default; unexpected timeouts may occur.
fix
Set retry: true or configure retryOptions.
affects: *
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'Tickets')
Instantiating ManageAPI without proper configuration or missing companyUrl.
fix
Ensure all required fields (companyId, companyUrl, publicKey, privateKey, clientId) are provided.
Error: connect ETIMEDOUT
Network timeout, retry disabled by default.
fix
Set retry: true or increase timeout in options.
Error: 401 Unauthorized
Invalid API keys or clientId.
fix
Verify companyId, publicKey, privateKey, and clientId.
Upgrade
Version history
2.0.0-alpha.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
42 hits · last 30 days
node
36
OpenAI (training)
1
Resources