SDKs
Thin clients over the REST API for TypeScript and Python, with typed errors and helpers for jobs.
Release status
Not on npm or PyPI yet
@sadafiles/sdk and sadafiles are at version 0.1.0 in the repository under packages/sdk. npm install and pip install will work once they are published. Until then, install from a checkout (npm install ./packages/sdk/ts after building it, or pip install ./packages/sdk/python) or call the API with HTTP.Basic usage
# No SDK needed: every call is plain HTTP.
curl "https://api.sadafiles.com/v1/tools/compress-pdf"Methods
| TypeScript | Python | Does |
|---|---|---|
run(slug, opts) | run(slug, files, options) | Run a tool, sync or as a job |
pipeline(steps, files, opts) | pipeline(steps, files, ...) | Run several tools in order, sync or as a job |
batch(slugOrSteps, files, options) | batch(slug_or_steps, files, options) | One job per file, with a ZIP of the outputs |
job(id) | job(id) | Load a job to wait on, download, cancel or continue |
delete(id) | delete(id) | Purge a job now |
api(slug, params) | api(slug, params) | Call a data API |
apiCatalog() | api_catalog() | List the data API catalog |
tools(), tool(slug) | tools(), tool(slug) | Read tool metadata |
lighthouse(url, opts) | lighthouse(url, ...) | Lighthouse audit of a public URL |
request(method, path, { json }) | request(method, path, json=...) | Call any other JSON route, such as the SEO tools |
attestation() | attestation() | Read the privacy configuration |
Failures raise SadaFilesError with code, status and step, using the codes in limits and errors. The clients send your key as X-API-Key.
Keys use the scopes tools:run, jobs:read and jobs:write. Pipelines and batches need tools:run; reading a job or batch back needs jobs:read. To get a callback, pass callbackUrl in TypeScript or callback_url in Python on run() or pipeline().
Other languages
Go, Java, .NET, PHP, Ruby and Dart clients are also in packages/sdk. They are unreleased and not covered by these docs; every language can call the REST API directly.

