Note
Preview. The TypeScript and Python SDKs are not published yet, and their package names will change before they are. This page will say how to install them once they are available. Until then, call the API directly.
HCode will have two SDKs for the customer API: one for TypeScript and JavaScript, and one for Python. Both are generated from the same definitions as the API, so every endpoint in the API reference has a matching method, with typed requests and responses.
Requirements
| SDK | Needs |
|---|---|
| TypeScript | Node.js 22 or later |
| Python | Python 3.11 or later. It uses only the standard library and has a synchronous and an asynchronous client. |
Both take two settings: your dashboard's address as the base URL, without the API path, and an API key. Keep the key in an environment variable rather than in your code.
How the SDKs behave
- They use HTTPS only, except for
localhostduring development, and refuse redirects, so your key is never sent to another host. - GET requests, and changes sent with an idempotency key, are retried after a temporary error. The SDKs wait for the time in a
Retry-Afterheader, up to 60 seconds by default, and return the error instead of waiting longer. File uploads are not retried. - A request times out after 30 seconds by default. In TypeScript this includes the whole life of a stream, so raise it for long log sessions.
- Errors carry the HTTP status, the error code and the request ID. Keep the request ID if you contact support.
- Helpers follow list pages and poll queued work until it finishes. A failed or cancelled operation is a finished result too, so check its status.
Saving configuration and deploying are separate calls, the same as in the API. Read Idempotency keys before retrying a deploy.