@phala/cloud v0.4.0 uses API version 2026-06-23 by default. The SDK sends the selected version in the X-Phala-Version header and returns matching TypeScript types.
Supported versions
Select a version
Omitversion to use 2026-06-23:
version when you need an older response shape:
.withVersion() to create another client with the same authentication and a different API version. The new client retains built-in actions and custom extensions, bound to the new version:
ApiVersion union. After withVersion(), custom methods remain callable with their original parameters, but their return types are unknown. Check or narrow those values before using them. This avoids assuming the old version’s response shape applies to the new version.
Version-aware return types
The client version controls the return type for versioned actions such asgetCvmList, getCvmInfo, getAppList, and lifecycle operations.
2026-05-22 and 2026-06-23 share the same CVM and app response types. Version 2026-06-23 changes the KMS resource model from individual KMS nodes to KMS contracts.
The client’s version overrides any X-Phala-Version value in config.headers, regardless of header casing. An action can still explicitly pin its own request to a different version, as the KMS methods below do.
Contract-centric KMS methods
The following methods always request API version2026-06-23, even when the client uses an older version:
listKmsContracts()getKmsContract({ slug })listKmsContractNodes({ slug })
getKmsList() and getKmsInfo() methods remain pinned to 2026-05-22 so existing code continues to receive the legacy node-centric response shape.

