Skip to main content

Uploading a new application

api.applications.create(file) uploads a zip and creates a brand-new application. The file argument is either a local file path or a Buffer.
Possible errors include UPLOAD_FAILED (upload could not be processed), STORAGE_UPLOAD_FAILED (storage backend rejected the file), INSUFFICIENT_MEMORY (plan doesn’t have enough RAM available) and FILE_TOO_LARGE (413, zip over the size limit). The zip must contain at least:
  • Main file — entry point of your application
  • Dependencies filepackage.json, requirements.txt, etc.
  • squarecloud.app — configuration file with name, description, main file, version, etc. See the config file guide

Committing files to an existing application

app.commit(file, fileName?) uploads files into an already-deployed application. Pass a zip to replace multiple files at once, or a single file to update just that one. Under the hood, the API accepts a path query parameter to control where the commit is written; the SDK sends it for you.
In v3 commit() accepted a third restart argument. In v4 the third parameter has been removed — use app.restart() after the commit if you need a restart.
Possible errors include UPLOAD_FAILED, STORAGE_UPLOAD_FAILED, INSUFFICIENT_MEMORY, FILE_TOO_LARGE (413), UPLOAD_ABORTED (the client aborted the upload) and COMMIT_FAILED.