メインコンテンツへスキップ
ここでカバーする最新パッチ:v4.0.1(2026-05-30 リリース)。

要件

  • Node.js 20.0.0 以降(v3 は Node 18 をサポートしていました)

破壊的変更の概要

v3.xv4.x
client.users.*client.user.*
app.backup / app.backupsapp.snapshots
Backup エクスポートSnapshot エクスポート
app.deploys.list() はフラットな Deployment[] を返すDeployment[][] を返す(以前の形式は .flat() を呼ぶ)
Deployment.id`git-${string}` 形式単なるコミットの SHA-1(40 桁の 16 進数)
app.network.dns() は配列を返す{ ownership, ssl } を返す
app.network.analytics() は引数を取らない{ start, end }(ISO 文字列または Date)が必要
app.network.purgeCache(paths?)purgeCache() — 引数は v4.0.1 で削除され、常にキャッシュ全体をパージする
app.custom === undefinedapp.custom === null
workspace.members / .applications はデータ配列を保持workspace.memberList / .applicationList にリネーム。元の名前は現在モジュールになっている
app.commit(file, name, restart)app.commit(file, name) — 第 3 引数は削除
app.files.create(content, fullPath)app.files.create(content, fileName, path)

リネーム

client.usersclient.user

// v3
await api.users.get();

// v4
await api.user.get();
api.usersapi.user へプロキシする非推奨のゲッターとして引き続きエクスポートされますが、実行時に警告を出力します。

Backups → Snapshots

// v3
await app.backups.create();
await app.backup.list();

// v4
await app.snapshots.create();
await app.snapshots.list();
Backup エクスポートは現在、Snapshot の非推奨エイリアスです。

Application

Application.custom

カスタムドメインがバインドされていない場合、app.custom は現在 null になりました(v3 では undefined でした)。

app.commit(file, fileName, restart)

第 3 引数の restart は削除されました。commit 後は手動で再起動してください。
// v3
await app.commit(buffer, "index.js", true);

// v4
await app.commit(buffer, "index.js");
await app.restart();

app.files.create(content, path)

シグネチャは現在 create(content, fileName, path = "/") です。移行方法:
// v3 — single combined path
await app.files.create(content, "./folder/test_file.txt");

// v4 — separate file name and directory
await app.files.create(content, "test_file.txt", "/folder");

Deploys

app.deploys.list() の形式

// v3
const events: Deployment[] = await app.deploys.list();

// v4
const timelines: Deployment[][] = await app.deploys.list();
const events = timelines.flat(); // same shape as v3

Deployment.id

`git-…` 形式の文字列ではなく、単なるコミットの SHA-1(40 桁の 16 進数)になりました。

Network

app.network.dns()

// v3
const records: DnsRecord[] = await app.network.dns();

// v4
const { ownership, ssl } = await app.network.dns();

app.network.analytics()

// v3
const data = await app.network.analytics();

// v4 — { start, end } is now required (ISO string or Date)
const data = await app.network.analytics({
    start: new Date(Date.now() - 24 * 60 * 60 * 1000),
    end:   new Date(),
});

app.network.purgeCache()

// v3 and v4.0.0
await app.network.purgeCache(["/static/old.js"]);

// v4.0.1 and later — selective purge removed
await app.network.purgeCache();

Workspaces

// v3
workspace.members;      // raw member data
workspace.applications; // raw application data

// v4
workspace.memberList;        // raw member data
workspace.applicationList;   // raw application data
workspace.members.add(...);  // members module
workspace.applications.add(...); // applications module

v4 の新機能

上記のリネームやシグネチャ変更に加えて、v4 では大幅な機能セットが追加されています。
  • Databases — 完全なライフサイクル、認証情報、snapshot、メトリクス(Databases
  • Workspaces — 招待コードとロールによるチームコラボレーション(Workspaces
  • 環境変数 — list / set / replace / delete(環境変数
  • アプリケーションメトリクス — 24 時間分の CPU/RAM/ネットワークサンプル(アプリケーションの管理
  • リアルタイム SSE ストリームapp.realtime()Realtime
  • エッジ分析 — analytics、errors、logs、latency のパーセンタイル(Network
  • GitHub App 連携app.deploys.linkGithubApp({ ... })Deploys
  • snapshot の復元app.snapshots.restore({ snapshotId, versionId })db.snapshots.restore(snapshotId, versionId)
  • status-all エンドポイントapi.applications.statusAll()api.databases.statusAll()
  • サービスステータスapi.service.status()
  • ユーザースコープの snapshotapi.user.snapshots(scope)
  • 新しい User フィールドUser.localeUser.createdAtUser.databases
  • 新しい BaseApplication フィールドdomaincustomcreatedAt
  • SquareCloudAPIError.codeswitch ベースのエラーハンドリング用に公開