Skip to main content
The package exports its types, so you can annotate your own code:
The types describe only part of what the API returns, and a few of them do not match it exactly. The SDK does not validate or convert responses: at runtime you receive the JSON of the API as is. The differences that are known are listed under each type. The API reference describes the real responses.

ApplicationResponseData

An application, as returned by getApplications, updateApplication, startApplication, stopApplication and restartApplication, and available in Application.data.
Differences from the API:
  • teamId is only a string (or null) in the application list and in the result of createApplication. In getApplication, updateApplication, startApplication, stopApplication and restartApplication the API returns the whole team object for team applications.
  • currentResourceMetrics is not returned when an application is created, so it is undefined in the data of the instance returned by createApplication.
  • internalPort, externalPort and assignedSubdomain can be missing (undefined) instead of null when the application is not exposed via web.
  • status can also be "error" after a failed rebuild.
  • The API returns more fields than the type declares, such as mainFile, environmentVariables, assignedCustomDomain, repository, githubDeploys and currentResourceMetrics.startedAt. They are present at runtime, but TypeScript does not know about them.

CreateApplicationDataParams

The argument of createApplication.
Differences from the API:
  • runtimeEnvironment does not include "bun", which the API accepts.
  • mainFile is required by the SDK, while the API also accepts a startupCommand without a mainFile.
  • There is no port nor assignedSubdomain, which the API requires when exposedViaWeb is true.
  • teamId is sent to the API as team.

UpdateApplicationDataParams

The argument of updateApplication. Application.update takes the same object without appId.
Differences from the API:
  • Every field of the API is optional, but the SDK requires appName, memoryMB and runtimeEnvironment (and the type also requires startupCommand).
  • teamId is ignored by the SDK. The API has no field to move an application to another team.
  • runtimeEnvironment does not include "bun".
  • There is no port, assignedSubdomain nor assignedCustomDomain.

UserData

The result of getMe.
Differences from the API:
  • activeSessions is declared as a tuple with exactly one session, but the API returns an array with any number of sessions (including none).
  • currentSubscription.status is "active", "pending_cleanup" or "grace_period" in the API. "suspended" is never returned.
  • currentSubscription.planReference.enabled is a boolean in the API, not a string.

TeamResponseData

The result of getTeam, and the item type of getTeams.
Differences from the API:
  • applicationsCount is only returned by getTeams. It is undefined in the result of getTeam.
  • The API also returns the permissions canManageApplicationBackup, canCreateDatabase, canDeleteDatabase, canUpdateDatabaseSettings and canChangeStatusDatabase.
  • The API returns more fields than the type declares, such as databaseInstancesCount (in getTeams), the owner’s currentSubscription (in getTeam) and the userId, invitedAt, code and subscriptionEndsAt of each invite.