# SDKs

Canonical: https://snapvisor.io/docs/sdks

> Official Snapvisor JavaScript packages under the @snapvisor namespace, plus a Python SDK and CLI for uploading builds from any pipeline.



Snapvisor ships open-source SDKs for JavaScript and Python. The JavaScript packages are drop-in forks of the official `@argos-ci` SDKs and deliberately keep the `ARGOS_*` environment variable names, so they work unchanged in pipelines already wired for Argos.

## JavaScript packages [#javascript-packages]

Pick the high-level SDK for your test framework:

* `@snapvisor/playwright` — capture screenshots from your Playwright tests
* `@snapvisor/cypress` — capture screenshots from your Cypress tests
* `@snapvisor/storybook` — capture screenshots of your Storybook stories
* `@snapvisor/puppeteer` — capture screenshots from your Puppeteer scripts
* `@snapvisor/vitest` — capture screenshots from your Vitest browser tests
* `@snapvisor/webdriverio` — capture screenshots from your WebdriverIO tests, see the [WebdriverIO guide](/webdriverio)
* `@snapvisor/cli` — interact with and upload screenshots from the command line
* `@snapvisor/core` — Node.js SDK, the base for building other integrations
* `@snapvisor/api-client` — typed client for the Snapvisor API
* `@snapvisor/browser` — browser utilities to stabilize visual testing
* `@snapvisor/util` — shared utilities used across the SDKs

Step-by-step setup guides, with the CI step, are on snapvisor.io for [Playwright](https://snapvisor.io/playwright), [Cypress](https://snapvisor.io/cypress) and [Storybook](https://snapvisor.io/storybook).

### Playwright example [#playwright-example]

```bash
npm install --save-dev @snapvisor/playwright
```

Set up the reporter in your Playwright config:

```ts
// playwright.config.ts
import { defineConfig } from "@playwright/test";
import { createArgosReporterOptions } from "@snapvisor/playwright/reporter";

export default defineConfig({
  reporter: [
    process.env.CI ? ["dot"] : ["list"],
    [
      "@snapvisor/playwright/reporter",
      createArgosReporterOptions({ uploadToArgos: !!process.env.CI }),
    ],
  ],
});
```

Then capture stable screenshots in your tests:

```ts
// tests/example.spec.ts
import { test } from "@playwright/test";
import { argosScreenshot } from "@snapvisor/playwright";

test("screenshot homepage", async ({ page }) => {
  await page.goto("http://localhost:3000");
  await argosScreenshot(page, "homepage");
});
```

### CLI example [#cli-example]

```bash
npm install --save-dev @snapvisor/cli
ARGOS_TOKEN="<your-project-token>" npx @snapvisor/cli upload ./screenshots
```

The CLI also exposes commands to deploy a static build, inspect and review builds, post a comment, and more — list them with `npx @snapvisor/cli --help`. Upload options such as `--build-name` and `--subset` are described in [CI integration](/ci-integration#upload-options).

## Python SDK and CLI [#python-sdk-and-cli]

The Python SDK uploads a directory of screenshots as a build from any Python test suite or CI pipeline — no Node.js required. It speaks the same upload protocol as `@snapvisor/core` and reads the same `ARGOS_*` environment variables. Requires Python 3.10+.

```bash
pip install git+https://github.com/DevinoSolutions/snapvisor-python
```

<Callout>
  The package is coming to PyPI as `snapvisor`; until then, install straight from GitHub as shown above.
</Callout>

CLI usage:

```bash
export ARGOS_TOKEN="<your-project-token>"
snapvisor upload ./screenshots
```

Python API:

```python
from snapvisor import upload

result = upload(
    "screenshots",
    token="...",            # or set ARGOS_TOKEN
    build_name="my-suite",  # optional
    branch="main",          # optional; resolved from env/git otherwise
    commit="abc...def",     # optional; resolved from env/git otherwise
    reference_branch="main" # optional baseline
)
```

The Python CLI also supports parallel shards (`--parallel-nonce`, `--parallel-total`, `--parallel-index`) and a custom `--api-base-url`.

