This page documents
@squarecloud/api v4. If you are upgrading from v3, read the v3 → v4 migration guide first.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
| Parameter | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | Your Square Cloud API key. The client will throw if this is not a string. |
Modules
The client exposes the entire v2 platform through dedicated modules. Each module is a property of theSquareCloudAPI instance.
| Property | Module | Documentation |
|---|---|---|
api.user | Authenticated user, plan, owned apps and databases | This page |
api.applications | List, fetch, upload and inspect applications | Managing applications |
api.databases | Create, fetch and manage databases | Databases |
api.workspaces | Create, list and manage workspaces | Workspaces |
api.service | Aggregate platform status | This page |
api.cache | In-memory cache populated by SDK events | This page |
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 v4.
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.

