Skip to main content

Requirements

Unchanged from v4: Node.js 20.0.0 or newer, both ESM and CJS.

Breaking changes summary

v4.xv5.x
client.users.* (deprecated proxy)Removed. Use client.user.*
app.backup / app.backupsRemoved. Use app.snapshots
Backup exportRemoved. Use Snapshot / DatabaseSnapshot
api.applications.create(file) returns { id, name, lang, ram }Returns { id, name, ram, cpu, language, description?, subdomain? }
app.network.dns() returns { ownership, ssl }Returns an array of DNS records

client.users removed

Unlike the v3 to v4 migration, there is no deprecated proxy this time. client.users no longer exists, calling it throws.
// v4
await api.users.get();

// v5
await api.user.get();

Backups removed

app.backup and app.backups are gone, along with the Backup export. Snapshots are the only supported path for both applications and databases.
// v4
await app.backups.create();
await app.backup.list();

// v5
await app.snapshots.create();
await app.snapshots.list();
Use the Snapshot class for application snapshots and DatabaseSnapshot for database snapshots.

api.applications.create(file) return shape

The created application now returns richer language and resource data instead of the flat lang/ram pair.
// v4
const { id, name, lang, ram } = await api.applications.create(file);

// v5
const { id, name, ram, cpu, language, description, subdomain } =
    await api.applications.create(file);

// language is now an object, e.g. { name: "javascript", version: "22" }
// cpu is the allocated CPU shares (number)
// description and subdomain are only present when set in squarecloud.config

app.network.dns() shape

dns() now returns an array of DNS records instead of a single { ownership, ssl } object.
// v4
const { ownership, ssl } = await app.network.dns();

// v5
const records = await app.network.dns();
// [{ type: "txt", name, value, status }, { type: "cname", name, value: "cname.squareweb.app", status }]
txt records cover both ownership and SSL validation; the cname record is the traffic record. status reflects the validation state (pending, pending_validation, active, and so on).

Other changes

  • ApplicationLanguage now includes ruby, alongside javascript, typescript, python, java, elixir, go, rust, php, dotnet and static.
  • Error codes were standardized. New names are exported through APIErrorCode; the old names remain available as deprecated type aliases. See error codes for the full rename table.