# @devtools-ai/js-sdk

> JS SDK for devtools.ai

Latest version **0.1.5** (published 2023-02-10) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @devtools-ai/js-sdk
pnpm add @devtools-ai/js-sdk
yarn add @devtools-ai/js-sdk
bun add @devtools-ai/js-sdk
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2023-02-10 |
| First published | 2022-06-24 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 21.8 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | DevTools AI |
| Maintainers | etienne_devtools_ai, jgarnica, chris-devtools |

## Links

- npm: https://www.npmjs.com/package/@devtools-ai/js-sdk
- npm.io page: https://npm.io/package/@devtools-ai/js-sdk

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) 0.27.2

## Recent versions

- 0.1.5 (latest) — 2023-02-10
- 0.0.3-5 (next) — 2022-06-24
- 0.0.3-4 (alpha) — 2022-06-24
- 0.1.2 — 2022-09-21
- 0.1.1 — 2022-09-08
- 0.1.0 — 2022-07-20
- 0.0.5 — 2022-07-13
- 0.0.4 — 2022-07-08
- 0.0.3 — 2022-06-24
- 0.0.3-2 — 2022-06-24

## README

[![dev-tools.ai sdk logo](https://dev-tools.ai/img/logo.svg)](https://dev-tools.ai/)

[![npm version](https://badge.fury.io/js/@devtools-ai%2Fjs-sdk.svg)](https://badge.fury.io/js/@devtools-ai%2Fjs-sdk)

#### Getting started

This starts the sdk and allows us to start interacting with
the DevTools AI API.

```ts
const sdk = createSDK({ apiKey: 'YOUR_API_KEY_HERE' });
```

Sample usage:

```ts
const response = await sdk.createCheckIn('My test name');
```

API Methods:
| Command | Description |
| --- | --- |
| createCheckIn | Creates a test session |
| getIfScreenshotExists| Returns if a screenshot for a test already exists |
| getTestCaseBox | Returns an object with properties like width, height, and position |
| getIfFrozen | Returns if an element in a test is frozen |
| updateTestElement | Updates an element in a test |
| uploadTestElementScreenshot | Uploads a screenshot for an element in a test |

SDK Options:

| Option                      | Description                                                                               |
| --------------------------- | ----------------------------------------------------------------------------------------- |
| apiKey                      | Sets the API key to interact with the DevTools AI API                                     |
| screenMultiplier            | Adjusts the display scaling ratio used when comparing element position within screenshots |
| useClassifierDuringCreation |                                                                                           |
| baseUrl                     | Changes the root address for the API. The default will work for most users.               |

#### Development

This repo uses pnpm as its package manager for [speed](https://pnpm.io/benchmarks) and efficient disk space management. In addition to having a node-js version >= 12.0 installed, you will need to install pnpm globally:

```
npm install -g pnpm
```

Afterwards you can all in the dependencies to run or build the SDK.

```sh
pnpm install
```

To run the TypeScript complier and build the files to
regular JS files, run:

```sh
pnpm run build
```

This will build the files to a dist folder.

---
_Source: https://npm.io/package/@devtools-ai/js-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
