> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrating to v5

> What changed between @squarecloud/api v4 and v5 — breaking changes and the smallest patches needed to upgrade.

## Requirements

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

## Breaking changes summary

| v4.x                                                              | v5.x                                                                 |
| ----------------------------------------------------------------- | -------------------------------------------------------------------- |
| `client.users.*` (deprecated proxy)                               | Removed. Use `client.user.*`                                         |
| `app.backup` / `app.backups`                                      | Removed. Use `app.snapshots`                                         |
| `Backup` export                                                   | Removed. 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.

```typescript theme={null}
// 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.

```typescript theme={null}
// 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.

```typescript theme={null}
// 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.

```typescript theme={null}
// 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](/en/sdks/js/client#error-codes-apierrorcode) for the full rename table.
