open-index/open-npm huggingface dataset:
npm package: @ridesafety/sdk
Description: ## Install
Latest version: 0.1.0

# RideSafety JS/TS SDK

## Install

```bash
pnpm add @ridesafety/sdk
```

## Build & publish

```bash
cd sdk/js
npm install
npm run build
npm login
npm publish --access public
```

## Usage

```ts
import { RideSafetyClient } from "@ridesafety/sdk"

const client = new RideSafetyClient({
  apiKey: process.env.RIDESAFETY_API_KEY!,
  baseUrl: "https://ridesafety.app",
})

const recalls = await client.getRecalls({ vin: "1HGBH41JXMN109186" })
const diagnostics = await client.runDiagnostics({
  vin: "1HGBH41JXMN109186",
  symptoms: "Rough idle and engine misfire",
  dtc_codes: ["P0300"],
})
const safety = await client.getSafetyRatings({ make: "Honda", model: "Civic", year: 2020 })
```

## Auth modes

By default the SDK uses `Authorization: Bearer <key>`. To use `x-api-key` instead:

```ts
const client = new RideSafetyClient({ apiKey, authMode: "x-api-key" })
```