---
description: Manage Capawesome Cloud from Node.js with the official SDK — apps, builds, channels, deployments, and more, fully typed and promise-based.
title: Node.js SDK - Capawesome
image: https://capawesome.io/docs/assets/images/social/cloud/sdks/node.png
---

<!doctype html> 

[Skip to content ](#nodejs-sdk) 

[🔐 Introducing the **Capacitor Vault** plugin — store secrets behind biometrics or a device passcode. ](/blog/announcing-the-capacitor-vault-plugin/) 

* [ SDKs ](/docs/sdks/)
* [ Formbricks ](/docs/sdks/capacitor/formbricks/)
* [ Geocoder ](/docs/sdks/capacitor/geocoder/)
* [ Google Sign-In ](/docs/sdks/capacitor/google-sign-in/)
* [ Grafana Faro ](/docs/sdks/capacitor/grafana-faro/)
* [ libSQL ](/docs/sdks/capacitor/libsql/)
* [ Live Update ](/docs/sdks/capacitor/live-update/)
* [ Managed Configurations ](/docs/sdks/capacitor/managed-configurations/)
* [ Media Session ](/docs/sdks/capacitor/media-session/)
* [ ML Kit ](/docs/sdks/capacitor/mlkit/)
* [ Navigation Bar ](/docs/sdks/capacitor/navigation-bar/)
* [ NFC ](/docs/sdks/capacitor/nfc/)
* [ OAuth ](/docs/sdks/capacitor/oauth/)
* [ Pedometer ](/docs/sdks/capacitor/pedometer/)
* [ Photo Editor ](/docs/sdks/capacitor/photo-editor/)
* [ PostHog ](/docs/sdks/capacitor/posthog/)
* [ Printer ](/docs/sdks/capacitor/printer/)
* [ Purchases ](/docs/sdks/capacitor/purchases/)
* [ RealtimeKit ](/docs/sdks/capacitor/realtimekit/)
* [ Screen Orientation ](/docs/sdks/capacitor/screen-orientation/)
* [ Screenshot ](/docs/sdks/capacitor/screenshot/)
* [ Secure Preferences ](/docs/sdks/capacitor/secure-preferences/)
* [ Speech Recognition ](/docs/sdks/capacitor/speech-recognition/)
* [ Speech Synthesis ](/docs/sdks/capacitor/speech-synthesis/)
* [ Share Target ](/docs/sdks/capacitor/share-target/)
* [ Square Mobile Payments ](/docs/sdks/capacitor/square-mobile-payments/)
* [ SQLite ](/docs/sdks/capacitor/sqlite/)
* [ Superwall ](/docs/sdks/capacitor/superwall/)
* [ Torch ](/docs/sdks/capacitor/torch/)
* [ Vault ](/docs/sdks/capacitor/vault/)
* [ Wifi ](/docs/sdks/capacitor/wifi/)
* [ Zip ](/docs/sdks/capacitor/zip/)
* [ Cordova ](/docs/sdks/cordova/)
* [ Cloud ](/docs/cloud/)
* [ Integrations ](/docs/cloud/live-updates/integrations/)
* Concepts
* Reference
* [ Troubleshooting ](/docs/cloud/live-updates/troubleshooting/)
* [ FAQ ](/docs/cloud/live-updates/faq/)
* [ Native Builds ](/docs/cloud/native-builds/)
* [ Set Up Environments ](/docs/cloud/native-builds/environments/)
* [ Overwrite Native Configurations ](/docs/cloud/native-builds/native-configurations/)
* [ Auto-Increment Build Numbers ](/docs/cloud/native-builds/auto-incrementing-build-numbers/)
* [ Configure the Web Build Script ](/docs/cloud/native-builds/web-build-script/)
* [ Build from a Monorepo ](/docs/cloud/native-builds/monorepo/)
* [ Use pnpm, Yarn, or bun ](/docs/cloud/native-builds/package-managers/)
* [ Install Private npm Packages ](/docs/cloud/native-builds/npm-private-registry/)
* [ Override the Java Version ](/docs/cloud/native-builds/override-java-version/)
* [ Custom iOS Provisioning Profiles ](/docs/cloud/native-builds/custom-ios-provisioning-profiles/)
* [ Build without Git ](/docs/cloud/native-builds/build-without-git/)
* [ Access Git Behind a Firewall ](/docs/cloud/native-builds/firewall-access/)
* [ Integrations ](/docs/cloud/native-builds/integrations/)
* Reference
* [ Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [ FAQ ](/docs/cloud/native-builds/faq/)
* [ App Store Publishing ](/docs/cloud/app-store-publishing/)
* [ Submit a Build ](/docs/cloud/app-store-publishing/submit-a-build/)
* [ Submit Automatically After a Build ](/docs/cloud/app-store-publishing/submit-automatically/)
* [ Troubleshooting ](/docs/cloud/app-store-publishing/troubleshooting/)
* [ FAQ ](/docs/cloud/app-store-publishing/faq/)
* [ Automations ](/docs/cloud/automations/)
* [ Reference ](/docs/cloud/automations/reference/)
* [ Troubleshooting ](/docs/cloud/automations/troubleshooting/)
* [ FAQ ](/docs/cloud/automations/faq/)
* [ Assist ](/docs/cloud/assist/)
* [ CLI ](/docs/cloud/cli/)
* APIs and SDKs
* [ Usage ](#usage)
* [ Error handling ](#error-handling)
* [ Reference ](#reference)
* [ Python ](/docs/cloud/sdks/python/)
* [ Webhooks ](/docs/cloud/webhooks/)
* [ Integrations ](/docs/cloud/integrations/)
* Account
* [ Organization ](/docs/cloud/organizations/)
* [ Two-Factor Enforcement ](/docs/cloud/organizations/two-factor-authentication/)
* [ Audit Logs ](/docs/cloud/organizations/audit-logs/)
* [ Billing ](/docs/cloud/organizations/billing/)
* [ License Keys ](/docs/cloud/license-keys/)
* [ AI ](/docs/ai/)
* [ Insiders ](/docs/insiders/)
* [ Billing & Plans ](/docs/insiders/billing-and-plans/)
* [ FAQ ](/docs/insiders/faq/)
* [ License ](https://capawesome.io/legal/eula/)
* [ Support ](/docs/support/)
* [ Contributing ](/docs/contributing/)
* Contributing code
* [ Code of Conduct ](/docs/contributing/code-of-conduct/)
* [ Questions ](https://docs.github.com/en/discussions/collaborating-with-your-community-using-discussions/participating-in-a-discussion#creating-a-discussion)
* [ Blog ](/blog/)
* Categories

* [ Usage ](#usage)
* [ Error handling ](#error-handling)
* [ Reference ](#reference)

# Node.js SDK[¶](#nodejs-sdk "Permanent link")

The official Node.js SDK, [@capawesome/cloud-sdk](https://www.npmjs.com/package/@capawesome/cloud-sdk), gives you a fully typed, promise-based interface to the [Capawesome Cloud API](/docs/cloud/api/). Use it to manage apps, Live Update channels and deployments, native builds, app store destinations, and more from your own backend or tooling — anywhere the [CLI](/docs/cloud/cli/) isn't a fit.

API in development

The Capawesome Cloud API is still evolving and may change without notice. Response types intentionally expose only the most relevant properties to keep breaking changes to a minimum.

## Installation[¶](#installation "Permanent link")

Install the package from npm. It requires **Node.js 20 or later** and is published as **ESM only**:

`[](#%5F%5Fcodelineno-0-1)npm install @capawesome/cloud-sdk
`

## Authentication[¶](#authentication "Permanent link")

Create an [API token](/docs/cloud/accounts/tokens/) in the Console and pass it to the client. Read it from an environment variable rather than hard-coding it:

`[](#%5F%5Fcodelineno-1-1)import { CapawesomeCloud } from "@capawesome/cloud-sdk";
[](#%5F%5Fcodelineno-1-2)
[](#%5F%5Fcodelineno-1-3)const client = new CapawesomeCloud({
[](#%5F%5Fcodelineno-1-4)  token: process.env.CAPAWESOME_TOKEN!,
[](#%5F%5Fcodelineno-1-5)});
`

## Getting started[¶](#getting-started "Permanent link")

Most operations are scoped to an app via `appId`, and every method takes a single options object and returns a typed promise:

`[](#%5F%5Fcodelineno-2-1)const apps = await client.apps.list({ organizationId: process.env.CAPAWESOME_ORGANIZATION_ID! });
[](#%5F%5Fcodelineno-2-2)const app = await client.apps.get({ appId });
`

### Configuration[¶](#configuration "Permanent link")

The client accepts a few options beyond the token:

| Option     | Type   | Default                         | Description                                                                |
| ---------- | ------ | ------------------------------- | -------------------------------------------------------------------------- |
| token      | string | —                               | API token used to authenticate.                                            |
| baseUrl    | string | https://api.cloud.capawesome.io | Base URL of the API.                                                       |
| timeout    | number | 60000                           | Request timeout in milliseconds. Does not apply to streamed downloads.     |
| maxRetries | number | 3                               | Retries for transient failures (network, 429, 5xx) on idempotent requests. |

## Usage[¶](#usage "Permanent link")

Resources mirror the API's path hierarchy: app-scoped resources are nested under `client.apps.*`, and top-level resources such as `client.jobs` sit directly on the client.

### Trigger a build and wait for it[¶](#trigger-a-build-and-wait-for-it "Permanent link")

A native build runs as a background **job**, so trigger it, then poll the job until it finishes:

`[](#%5F%5Fcodelineno-3-1)const build = await client.apps.builds.create({
[](#%5F%5Fcodelineno-3-2)  appId,
[](#%5F%5Fcodelineno-3-3)  platform: "ios",
[](#%5F%5Fcodelineno-3-4)  gitRef: "main",
[](#%5F%5Fcodelineno-3-5)});
[](#%5F%5Fcodelineno-3-6)
[](#%5F%5Fcodelineno-3-7)let job = await client.jobs.get({ jobId: build.jobId! });
[](#%5F%5Fcodelineno-3-8)while (job.status === "queued" || job.status === "pending" || job.status === "in_progress") {
[](#%5F%5Fcodelineno-3-9)  await new Promise((resolve) => setTimeout(resolve, 5000));
[](#%5F%5Fcodelineno-3-10)  job = await client.jobs.get({ jobId: job.id });
[](#%5F%5Fcodelineno-3-11)}
`

### Promote a build to a channel[¶](#promote-a-build-to-a-channel "Permanent link")

Create a deployment to publish a build to a Live Update channel — optionally as a gradual rollout:

`[](#%5F%5Fcodelineno-4-1)const deployment = await client.apps.deployments.create({
[](#%5F%5Fcodelineno-4-2)  appId,
[](#%5F%5Fcodelineno-4-3)  appBuildId,
[](#%5F%5Fcodelineno-4-4)  appChannelName: "production",
[](#%5F%5Fcodelineno-4-5)  rolloutPercentage: 0.5,
[](#%5F%5Fcodelineno-4-6)});
`

### Download a build artifact[¶](#download-a-build-artifact "Permanent link")

Binary downloads return a `ReadableStream`, so large files stream straight to disk without buffering in memory:

`[](#%5F%5Fcodelineno-5-1)import { Writable } from "node:stream";
[](#%5F%5Fcodelineno-5-2)import { createWriteStream } from "node:fs";
[](#%5F%5Fcodelineno-5-3)
[](#%5F%5Fcodelineno-5-4)const stream = await client.apps.builds.artifacts.download({ appId, buildId, artifactId });
[](#%5F%5Fcodelineno-5-5)await stream.pipeTo(Writable.toWeb(createWriteStream("artifact.ipa")));
`

## Error handling[¶](#error-handling "Permanent link")

Any non-`2xx` response is thrown as a `CapawesomeCloudError` carrying the status code, message, and raw body:

`[](#%5F%5Fcodelineno-6-1)import { CapawesomeCloudError } from "@capawesome/cloud-sdk";
[](#%5F%5Fcodelineno-6-2)
[](#%5F%5Fcodelineno-6-3)try {
[](#%5F%5Fcodelineno-6-4)  await client.apps.get({ appId: "unknown" });
[](#%5F%5Fcodelineno-6-5)} catch (error) {
[](#%5F%5Fcodelineno-6-6)  if (error instanceof CapawesomeCloudError) {
[](#%5F%5Fcodelineno-6-7)    console.error(error.status); // 404
[](#%5F%5Fcodelineno-6-8)    console.error(error.message); // "App not found."
[](#%5F%5Fcodelineno-6-9)  }
[](#%5F%5Fcodelineno-6-10)}
`

## Reference[¶](#reference "Permanent link")

The SDK covers the full API surface — apps, channels, deployments, builds and artifacts, certificates, environments, automations, devices, webhooks, and jobs. For the complete list of resources and options, see the [package on npm](https://www.npmjs.com/package/@capawesome/cloud-sdk) and the [source on GitHub](https://github.com/capawesome-team/cloud-node), or browse the underlying [Cloud API](/docs/cloud/api/).

June 8, 2026 

Back to top