You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The official TypeScript/JavaScript client for the [Teslemetry](https://teslemetry.com) API.
4
4
5
-
This library provides a convenient wrapper for interacting with Tesla vehicles and energy sites via the Teslemetry service, including support for standard API commandsand real-time streaming data (Server-Sent Events).
5
+
This library provides a strictly typed, easy-to-use wrapper for interacting with Tesla vehicles and energy sites. It supports standard API commands, state retrieval, and real-time streaming data via Server-Sent Events (SSE).
6
6
7
-
Further information about each API method can be found in the [Teslemetry API Documentation](https://teslemetry.com/docs/api), and [Tesla Fleet API Documentation](https://developer.tesla.com/docs/fleet-api/endpoints/vehicle-commands).
7
+
## 📚 Documentation
8
8
9
-
## Features
10
-
11
-
- 🚗 **Vehicle API**: Full control and state retrieval (lock/unlock, climate, charging, etc.).
12
-
- ⚡ **Energy API**: Monitor and control Tesla Energy sites (Solar, Powerwall).
13
-
- 📡 **Streaming (SSE)**: Real-time vehicle data streaming with `TeslemetryStream`.
14
-
- 🌍 **Region Aware**: Automatic region detection and handling (NA/EU).
15
-
- 🔒 **Type-Safe**: Built with TypeScript for full type inference and safety.
9
+
-**[Teslemetry API Reference](https://teslemetry.com/docs/api)**: Detailed documentation for all API endpoints, parameters, and response values.
10
+
-**[Tesla Fleet API](https://developer.tesla.com/docs/fleet-api)**: Official Tesla documentation for underlying vehicle commands and data.
Initialize the `Teslemetry`client with your access token. You can optionally specify a region ("na" or "eu"), otherwise it will be automatically detected.
54
+
The `Teslemetry`class is the main entry point. It automatically handles region detection (NA/EU) upon the first request, or you can specify it manually.
> **Note:** For a comprehensive list of all available methods and their parameters, please refer to the [Teslemetry API Docs](https://teslemetry.com/docs/api). The SDK methods map 1:1 with these endpoints.
86
94
87
-
Teslemetry supports streaming vehicle data updates via Server-Sent Events.
95
+
#### Real-time Streaming (SSE)
96
+
The `.sse` property allows you to subscribe to specific vehicle signals.
The SDK throws standard Javascript `Error` objects for configuration issues and specific errors for API failures. Streaming errors (like connection drops) are emitted via the stream error handler or specific exception classes.
0 commit comments