Application instance:
api.applications.fetch(id) returns an Application. When the app has a website domain bound to it, it is returned as a WebsiteApplication — refine the type at runtime with app.isWebsite() before using .network (see Network).
Application properties
| Property | Type | Description |
|---|---|---|
id | string | Application ID (24 hex chars) |
name | string | Display name |
description | string? | Description from squarecloud.app |
url | string | Web dashboard URL |
ram | number | Allocated RAM in MB |
cluster | string | Cluster the app runs on |
language | string | javascript | typescript | python | java | elixir | rust | go | php | dotnet | static |
domain | string | null | Default <subdomain>.squareweb.app host (null for non-web apps) |
custom | string | null | Custom domain bound to the app, when configured |
createdAt | Date | Creation date |
In v4,
app.custom is null when no custom domain is set (was undefined in v3).Getting the application status
app.getStatus() returns an ApplicationStatus instance with the live runtime state.
Summary status for every application
To avoid one request per app, callapi.applications.statusAll():
Getting the logs
app.getLogs() returns the most recent log output as a string.
Getting metrics
app.getMetrics() returns the last 24 hours of CPU, RAM and network samples (up to 288 points, one every 5 minutes).
Real-time event stream
app.realtime() opens a Server-Sent Events stream. See the dedicated Realtime page for a full example.
Lifecycle
All lifecycle methods resolve toboolean (true on success).
Deleting an application
Refreshing the application data
app.fetch() refetches the application from the API and returns a brand-new Application instance. Use it when you suspect the cached data is stale.

