Square Cloud in your code, in JavaScript, Python and Go

The official SDKs for the Square Cloud API. Deploy, restart, read logs, edit files, take snapshots and set domains from your own scripts, with zero runtime dependencies.

Open source on GitHub, with the same methods and errors in every language.

Pick a language and install

Four official packages: three for the Square Cloud API and one for Blob Storage. Each one needs only its language's runtime.

  • JavaScript and TypeScript

    @squarecloud/api

    Node.js 22+, Deno, Bun and edge runtimes

    npm install @squarecloud/api

    DocsSource code

  • Python

    squarecloud-api

    Python 3.11+, with sync and async clients

    pip install squarecloud-api

    DocsSource code

  • Go

    github.com/squarecloudofc/sdk-api-go/v3

    Go 1.22+, with a context on every call

    go get github.com/squarecloudofc/sdk-api-go/v3

    DocsSource code

  • Blob Storage

    @squarecloud/blob

    Node.js 20+ and the browser

    npm install @squarecloud/blob

    DocsSource code

Your first call

Create an API key, set it as the SQUARECLOUD_API_KEY environment variable and run one of these programs. Each one prints your name and how many applications the key can see.

index.mjs
import { SquareCloudAPI } from "@squarecloud/api";const api = new SquareCloudAPI(process.env.SQUARECLOUD_API_KEY);const { user, applications } = await api.account.me();console.log(`Hi ${user.name}, you have ${applications.length} apps`);
main.py
import osfrom squarecloud import SquareCloudwith SquareCloud(os.environ["SQUARECLOUD_API_KEY"]) as client:    me = client.account.me()    print(f"Hi {me['user']['name']}, you have {len(me['applications'])} apps")
main.go
package mainimport (	"context"	"fmt"	"log"	"os"	"github.com/squarecloudofc/sdk-api-go/v3")func main() {	c := squarecloud.New(os.Getenv("SQUARECLOUD_API_KEY"))	me, err := c.Account.Me(context.Background())	if err != nil {		log.Fatal(err)	}	fmt.Printf("Hi %s, you have %d apps\n", me.User.Name, len(me.Applications))}

Everything the API does, from your code

The JavaScript, Python and Go SDKs cover every operation in the API reference, checked against its OpenAPI spec on every CI run. The method names below are in JavaScript; Python uses snake_case and Go uses PascalCase.

  • Applications

    Read the status of one application or all of them, start, stop and restart, and fetch logs and CPU, RAM and network metrics.

    apps.statusAllapps.restartapps.logsapps.metrics

  • Deploys

    Create an application from a zip, commit new files to it, link a GitHub repository and branch or set a webhook, and list past deploys.

    apps.createapps.commitdeploys.linkGithubApp

  • Files and variables

    List, read, write, move and delete your application's files, and get, set or replace its environment variables.

    files.writefiles.readenvs.set

  • Realtime

    Follow an application's logs and status as they happen, as an iterator you loop over. A dropped connection reopens on its own.

    apps.realtime

  • Snapshots

    Create, list and restore snapshots of applications and databases, and download a snapshot file as a stream.

    snapshots.createsnapshots.restoredownloadSnapshot

  • Network

    Set a custom domain, read its DNS records, purge the cache and query analytics, errors and performance for a time window.

    network.setDomainnetwork.purgeCachenetwork.analytics

  • Databases

    Create MongoDB, PostgreSQL, MySQL and Redis databases, change their RAM, read their status and reset a password or certificate.

    databases.createdatabases.resetCredentials

  • Workspaces

    Create workspaces, add members with an invite code, change their group and share applications with your team.

    workspaces.members.addworkspaces.apps.add

  • AI

    Send an OpenAI-compatible chat request to the Square Cloud AI Gateway with the same client and the same key.

    ai.chat

Blob Storage from JavaScript

@squarecloud/blob is the SDK for Blob Storage: uploads, private files, share links, folder rules and the S3-compatible gateway, on Node.js and in the browser. See Blob Storage

  • Large uploads

    Pass a file path, a Blob or bytes. Large files go up in parallel parts, up to 10 GiB, streamed from disk.

    putlist

  • Private files

    A private file has no public URL. Create a download link that expires, or a share link you can revoke anytime.

    downloadUrlshares.createshares.revoke

  • Uploads from the browser

    Your server creates a short-lived upload token and the browser uploads with it, so the API key never leaves your server.

    uploadTokens.create

Built the same way in every language

  • Zero dependencies

    Each SDK uses only its language's standard library or the platform's fetch, so it adds nothing else to your lockfile.

  • One error type

    Every API, network and local failure throws the same error class, with the HTTP status and the API's error code.

  • Safe retries

    A 30-second timeout per attempt, and retries only for failures that are safe to repeat, never for a 429.

  • Scoped keys

    A key can be limited to some permissions and to specific applications or databases. Lists return only what it can see.

A plan for every stage of your project

Start small and scale when you need to, with no loyalty contracts.

4.9 out of 5 · 402 reviews on Google + TrustpilotTrustpilot

Hosted in a partner datacenter with certifications
Tier 3ISO 27001SOC 2 Type IIAlways-On DDoS Protection
Explore our infrastructure

Questions about the SDKs

Which languages have an official Square Cloud SDK?

JavaScript and TypeScript (@squarecloud/api), Python (squarecloud-api) and Go (github.com/squarecloudofc/sdk-api-go). Blob Storage has its own JavaScript SDK, @squarecloud/blob. All four are open source on GitHub.

Do the SDKs cover the whole API?

Yes. The JavaScript, Python and Go SDKs cover every operation in the Square Cloud API reference, plus snapshot downloads, and are checked against its OpenAPI spec on every CI run. Blob Storage and its S3-compatible gateway are covered by @squarecloud/blob.

Which plan do I need to use the SDKs?

The SDKs are open source packages. The API they call is included in every Square Cloud plan, starting at Hobby, and the number of requests per minute depends on the plan.

Where should I keep my API key?

In the SQUARECLOUD_API_KEY environment variable, never in your source code. Give each key only the permissions and resources it needs, and revoke it in your account's security settings if it leaks.

Can I use the SDKs in the browser?

The API SDKs are meant for servers: Node.js, Deno, Bun, edge runtimes, Python and Go. In a browser the API key would be exposed. For uploads from a browser, @squarecloud/blob uses a short-lived upload token created by your server.

I use an older version. What changed?

The current versions are rewrites: methods live on the client, responses are plain data with the API's own field names, and every failure has one error type. Each SDK's documentation has a migration guide from the previous major version.

SDK, CLI or GitHub Action: which one should I use?

Use an SDK when the call lives in your code, like a bot command that restarts an application or a script that takes a snapshot. Use the CLI in the terminal, and the GitHub Action to deploy on every push.

Ready to scale your project?

Join the 500,000+ developers who have used Square Cloud to host their projects.

  • Predictable pricing
  • No billing surprises
  • Deploy in seconds
  • High availability
  • Scale with stability
  • Automatic restart
  • SSL and security included
  • Isolated containers