Skip to main content
Arga provides official SDKs for Python and TypeScript. Both now expose the newer run-model resources for sandboxes, twin runs, saved tests, and ad hoc test runs, while still keeping the older runs helpers for legacy validation flows.

Python

Sync and async support. Works with any Python 3.10+ project.

TypeScript

Zero dependencies. Uses native fetch (Node 18+).

What the SDKs cover

Both SDKs wrap the same core namespaces:
NamespaceWhat it does
Sandbox runsDeploy app code plus selected twins. Inspect sandbox URLs and logs.
Twin runsProvision standalone digital twin environments, extend TTL, lock public access, or tear them down.
TestsCreate, list, fetch, and run saved browser tests.
Test runsStart ad hoc browser runs, rerun them, and poll for completion.
TwinsLegacy twin quickstart helpers on the older /validate/twins/... routes.
ScenariosCreate reusable twin seed configurations and reuse them across runs.
RunsLegacy validation-run helpers kept for older /validate/... workflows.
Current SDK packages still include legacy agent-run helpers, but those helpers target the removed /validate/agent-run endpoint. Prefer sandbox_runs / sandboxRuns, twin_runs / twinRuns, tests, and test_runs / testRuns for new integrations.

Authentication

All SDK methods require an API key. Get one by running:
arga login
The CLI stores your key locally. To use it in the SDK, copy the key from your Arga dashboard or pass it directly:
from arga_sdk import Arga

client = Arga(api_key="arga_sk_...")

Example projects

Both SDK repositories include reference tests and package-level examples for the current supported workflows — release gating, scenario creation, seeded twin provisioning, and standalone twin provisioning.
ExampleWhat it does
Validate staging releaseRun browser validation against staging and exit non-zero if it fails — drop it into CI to gate releases.
Create checkout scenarioBuild a reusable scenario with seed data and tags so your team can replay the same flow across runs.
Provision twins from a scenarioStart a seeded twin session from a saved scenario and print the resulting base_urls.
Provision checkout twinsSpin up disposable service twins (e.g. Stripe), wait until ready, and print the URLs and env vars.

Python examples

uv run python examples/validate_staging_release.py

TypeScript examples

npx tsx examples/validate_staging_release.ts

Base URL

Both SDKs default to https://app.argalabs.com. Override this if you’re targeting a different environment:
client = Arga(api_key="...", base_url="https://your-instance.example.com")