# teslastreaming

> A module for using the tesla streamin API

Latest version **0.0.2** (published 2020-10-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install teslastreaming
pnpm add teslastreaming
yarn add teslastreaming
bun add teslastreaming
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2020-10-28 |
| First published | 2020-10-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 27.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Dr. Patrick Bartsch |
| Maintainers | wzr1337 |
| Keywords | tesla, inofficial, streamin, api |

## Links

- npm: https://www.npmjs.com/package/teslastreaming
- npm.io page: https://npm.io/package/teslastreaming

## Dependencies (3)

- [ws](https://npm.io/package/ws.md) ^7.3.1
- [rxjs](https://npm.io/package/rxjs.md) ^6.6.3
- [typescript](https://npm.io/package/typescript.md) ^4.0.3

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2020-10-28

## README

# TeslaStreaming

[![Build Status](https://travis-ci.com/wzr1337/teslaStreaming.svg?branch=master)](https://travis-ci.com/wzr1337/teslaStreaming)

This module is used to connect to and listen on the Tesla streaming API, exposed via WebSocket. The API is a convenience method in extension of the regular REST API (<https://teslapi.io>), which needs to be polled.

This module is **UNOFFICIAL**.

## prerequisites

In order to use the streaming API, you need to obtain an `access_token` via the auth REST API.

## Installation

Add this module to your project using

`$ npm i teslastreaming`

## Usage

The following example stores a log of messages into an array, a very basic logger if you will:

```typescript
import { teslaAPI } from "./index";

const vehicleId = '<yourVehicleId>';
const token = '<yourAccessToken>';

const messages = [];

teslaAPI(vehicleId, token).subscribe((event)=> {
  messages.push(event);
  console.log(`messages received: ${messages.length}`);
  console.log(`Tesla says: ${JSON.stringify(event, null, 2)}`)
});
```

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