Official libraries for calling JustDeploy from the code you deploy. They cover your database, your files, and sending email, and a deployed app needs no keys at all: JustDeploy puts an identity in the image and the library uses it.
They are for server code. If you are only deploying an app and not calling JustDeploy from inside it, you do not need any of this.
npm install @justdeploy/sdk@0.1.1python -m pip install justdeploy-sdk==0.1.1The Python package installs as justdeploy-sdk and imports as justdeploy. Both are published from our own repository and carry the same version.
Construct the client with no arguments. There is no API URL, no key, and no configuration file to pass.
import { JustDeploy } from '@justdeploy/sdk'
const justdeploy = new JustDeploy()
const result = await justdeploy.databases.query('your-database-id', 'SELECT * FROM orders')from justdeploy import JustDeploy
with JustDeploy() as justdeploy:
result = justdeploy.databases.query("your-database-id", "SELECT * FROM orders")Python also ships AsyncJustDeploy with the same methods, awaited.
It looks in one fixed order:
JUSTDEPLOY_ACCESS_KEY and JUSTDEPLOY_SECRET_KEY in the environment: it trades them for a short-lived session. This is how you run the code on your own machine.One variable set without the other is an error, and a rejected key never quietly falls back to the deployment identity. An app that already has keys registered keeps using them, and nothing about your build changes if you leave them in place.
.env file itself. Your local runner may, so keep that file out of version control.Three areas, named the same way in both languages. Python method names are in snake case, so listTables is list_tables.
justdeploy.databases.list()
justdeploy.databases.query(databaseId, 'SELECT * FROM orders')
justdeploy.databases.listTables(databaseId)
justdeploy.databases.createTable(databaseId, { ... })
justdeploy.databases.updateTable(databaseId, 'orders', { ... })
justdeploy.databases.deleteTable(databaseId, 'orders')justdeploy.storages.list()
justdeploy.storages.upload(storageId, { ... })
justdeploy.storages.listFiles(storageId, { limit: 50 })
justdeploy.storages.getFile(storageId, fileId)
justdeploy.storages.download(storageId, fileId)
justdeploy.storages.deleteFile(storageId, fileId)justdeploy.mail.send({ ... })
justdeploy.mail.list({ limit: 50 })
justdeploy.mail.get(mailId)Two things behave differently from what the shapes suggest. query takes data statements only, so use the table methods to change a schema. And an upload gives you a file id, not a lasting URL: store the id, then call getFile when you need a fresh link.
Pass an idempotencyKey when sending email if a retry is possible, and remember that a successful send means accepted rather than delivered. Read status back later if delivery matters.
Every failure is a JustDeployError. An error from the API carries status, retryAfter, requestId, and details, which is enough to decide whether waiting helps. Your request body, your SQL, your file contents, and your keys are never kept on the error, so it is safe to log the error itself.
Presigned uploads and downloads never carry your credentials, so a file transfer cannot leak them. Asking for a file whose upload is still finishing gives you a retry-later error rather than a half-written response. See Authentication for the raw header, and Credentials for managing keys.