This page documents
@squarecloud/api v5. If you are upgrading from v4, read the v4 → v5 migration guide first. Coming from v3, see the v3 → v4 migration guide.Requirements
- Node.js 20.0.0 or newer
- A valid API key — request one at the Square Cloud Dashboard
Installation
- npm
- yarn
- pnpm
Instantiating the client
- TypeScript
- JavaScript (ESM)
- JavaScript (CommonJS)
Constructor
Modules
The client exposes the entire v2 platform through dedicated modules. Each module is a property of theSquareCloudAPI instance.
Getting the authenticated user
api.user.get() returns a User instance containing the account details, current plan, owned applications and owned databases.
user.applications and user.databases are Collection instances (a Map subclass). Iterate them like any Map:
Fetching a single application
Useapi.applications.fetch(id) to retrieve a fully populated Application (or WebsiteApplication, when the app has a website domain).
api.applications.get(id) overload still exists, but it returns the lighter BaseApplication and is only kept for backwards compatibility. Prefer .fetch() for v5.
Listing snapshot history (account-wide)
Platform status
api.service.status() exposes the aggregated platform health (the same data shown on the public status page).
Unlike most v2 endpoints, this route does not wrap its payload in the standard
{ status, response } envelope.Client cache
The client maintains an in-memory cache that the SDK keeps in sync as you make calls:Error handling
Failed requests throw aSquareCloudAPIError. The error exposes a stable code property you can switch on to discriminate failure modes.
Error codes (APIErrorCode)
APIErrorCode is a const/union exported by the SDK (re-exported from @squarecloud/api-types) listing every value err.code can take. v5 renamed several codes for consistency; the old names are kept as deprecated type aliases, but the SDK now throws only the new names.
Unchanged codes:
KEEP_CALM (short 429, retry in seconds), ACCESS_DENIED (401), PAYLOAD_TOO_LARGE (413), RATE_LIMIT_EXCEEDED.
New in v5:

