# Serp API JS library

## Installation

### NPM

```bash
npm i --save @serp/api
```

### Yarn

```bash
yarn add @serp/api
```

## Usage

```js
// ES2015 module import:
import { createSerpRestApi, createSerpWsApi } from "@serp/api";

// CommonJS module require:
const { createSerpRestApi, createSerpWsApi } = require("@serp/api");

// REST
const SerpRestApi = createSerpRestApi({
  version: 1,
  token: "YOUR_SERP_TOKEN",
});

// WebSocket
const SerpWsApi = createSerpWsApi({
  version: 1,
  token: "YOUR_SERP_TOKEN",
});

SerpWsApi.connect();
```
