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.
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/apiPython
squarecloud-api
Python 3.11+, with sync and async clients
pip install squarecloud-apiGo
github.com/squarecloudofc/sdk-api-go/v3
Go 1.22+, with a context on every call
go get github.com/squarecloudofc/sdk-api-go/v3Blob Storage
@squarecloud/blob
Node.js 20+ and the browser
npm install @squarecloud/blob
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.
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`);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")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.metricsDeploys
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.linkGithubAppFiles and variables
List, read, write, move and delete your application's files, and get, set or replace its environment variables.
files.writefiles.readenvs.setRealtime
Follow an application's logs and status as they happen, as an iterator you loop over. A dropped connection reopens on its own.
apps.realtimeSnapshots
Create, list and restore snapshots of applications and databases, and download a snapshot file as a stream.
snapshots.createsnapshots.restoredownloadSnapshotNetwork
Set a custom domain, read its DNS records, purge the cache and query analytics, errors and performance for a time window.
network.setDomainnetwork.purgeCachenetwork.analyticsDatabases
Create MongoDB, PostgreSQL, MySQL and Redis databases, change their RAM, read their status and reset a password or certificate.
databases.createdatabases.resetCredentialsWorkspaces
Create workspaces, add members with an invite code, change their group and share applications with your team.
workspaces.members.addworkspaces.apps.addAI
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.
putlistPrivate files
A private file has no public URL. Create a download link that expires, or a share link you can revoke anytime.
downloadUrlshares.createshares.revokeUploads 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.
The rest of the toolbox
The same API key and the same SQUARECLOUD_API_KEY variable work in the terminal, in CI, in your editor and in your code.
A plan for every stage of your project
Start small and scale when you need to, with no loyalty contracts.
Hobby
To validate ideas, bots and personal projects
From R$12.49/mo ≈ $2.25
- 1 GB RAM
- 1 vCPU
- Up to 4 projects
- Scales up to 2 GB on the same plan
Standard
RecommendedFor production, with databases and custom domains
From R$44.99/mo ≈ $8.10
- 4 GB RAM
- 4 vCPU
- Up to 16 projects
- Scales up to 8 GB on the same plan
Pro
For high scale, with daily application snapshots and advanced analytics
From R$124.99/mo ≈ $22.50
- 12 GB RAM
- 6 vCPU
- Up to 48 projects
- Scales up to 24 GB on the same plan
4.9 out of 5 · 402 reviews on Google + TrustpilotTrustpilot
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.