> ## Documentation Index
> Fetch the complete documentation index at: https://alguna.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# SDKs and CLI

> Official Alguna client libraries for TypeScript, Python, Go and Rust, and the alguna command-line tool: packages, install commands and source repositories.

> [!NOTE]
>
> New to the libraries? The [SDKs and CLI guide](https://alguna.com/docs/guides/sdks-and-cli.md) walks through choosing one, installing it, connecting, and a first call in each.

Alguna publishes a client library for TypeScript, Python, Go and Rust, and the `alguna` command-line tool. Use one when you call the [public API](https://alguna.com/docs/api-reference/v2/overview.md) from code or from a terminal and do not want to write the HTTP calls yourself. All five are generated from the same versioned OpenAPI spec as this reference, so every endpoint has a method (or a command), and they behave the same way:

* They send the `Authorization` and `Alguna-Version` headers. The API version defaults to the one the release was generated against; set it to pin the version you integrate against.
* They send an `Idempotency-Key` on every write, yours or a generated one, and reuse it on each retry. See [Idempotency](https://alguna.com/docs/api-reference/v2/idempotency.md).
* They retry `408`, `429`, `502`, `503` and `504`, a `409` with `Retry-After`, and network failures, 2 times by default. They do not retry a `500`. See [Errors](https://alguna.com/docs/api-reference/v2/errors.md#retrying).
* They raise a typed error for a failed response, with the HTTP status and the `X-Request-Id`.

The API key is a secret. Use the libraries on a server only. For a purchase flow in the browser, use [Embedded Checkout](https://alguna.com/docs/hosted/embedded-checkout.md) (`@alguna/checkout-sdk`).

## Libraries

| Language | Package | Install | Source |
| - | - | - | - |
| [TypeScript](https://alguna.com/docs/api-reference/v2/sdks/typescript.md) | [`@alguna/sdk`](https://www.npmjs.com/package/@alguna/sdk) on npm | `npm install @alguna/sdk` | [alguna-io/alguna-ts](https://github.com/alguna-io/alguna-ts) |
| [Python](https://alguna.com/docs/api-reference/v2/sdks/python.md) | [`alguna`](https://pypi.org/project/alguna/) on PyPI | `pip install alguna` | [alguna-io/alguna-python](https://github.com/alguna-io/alguna-python) |
| [Go](https://alguna.com/docs/api-reference/v2/sdks/go.md) | [`github.com/alguna-io/alguna-go`](https://pkg.go.dev/github.com/alguna-io/alguna-go) | `go get github.com/alguna-io/alguna-go` | [alguna-io/alguna-go](https://github.com/alguna-io/alguna-go) |
| [Rust](https://alguna.com/docs/api-reference/v2/sdks/rust.md) | [`alguna`](https://crates.io/crates/alguna) on crates.io | `cargo add alguna` | [alguna-io/alguna-rust](https://github.com/alguna-io/alguna-rust) |
| [CLI](https://alguna.com/docs/api-reference/v2/sdks/cli.md) | [`@alguna/cli`](https://www.npmjs.com/package/@alguna/cli) on npm, and [GitHub Releases](https://github.com/alguna-io/cli/releases) | `npm install --global @alguna/cli` | [alguna-io/cli](https://github.com/alguna-io/cli) |

Each repository's README is the full reference for that library. When you report a problem with a call, include its `X-Request-Id`.

## Versions

A library has two versions, and they change independently:

* The **package version** is the release of the library. A new package version adds endpoints and types and fixes defects. Each release has a `v<version>` tag in its repository.
* The **API version** is the date in the `Alguna-Version` header. Only the API version changes the request and response shapes. When you set it on the client, a newer package version still sends the date you set. See [Versioning](https://alguna.com/docs/api-reference/v2/overview.md#versioning).

## Sandbox

Every library and the CLI take a base URL. Set it to `https://api.sandbox.alguna.io` and use a sandbox API key to work against your sandbox. See [Testing](https://alguna.com/docs/getting-started/testing.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.