Skip to content

mihaiblaga89/bmw-connecteddrive-api

Repository files navigation

bmw-connecteddrive-api

codecov Actions Status CodeFactor License

JavaScript implementation of the BMW's ConnectedDrive API

Example: BMWStatus

Usage

import API from '@mihaiblaga89/bmw-connecteddrive-api';

await API.init({
    region: 'eu',
    username: 'user@example.com',
    password: 'mySuperPassword',
});

const vehicles = await API.getVehicles();

const vehicleStatus = await vehicles[0].getStatus();

API Methods

API.init(options)

Initializes the API with your credentials. By default it also fetches your vehicles and saves them but you can disable this behaviour if you want. More info

API.getVehicles(force)

Returns your prefetched vehicles or queries the BMW API for them. Has the option to force the query to refresh your vehicles. Every vehicle is an instance of Vehicle. More info

Vehicle Methods

Vehicle.getImage(width, height, view)

Fetches and caches your vehicle image from BMW API. Of course it's not the actual photo, it's just a car photo based on your car's model and color :). Several "views" are available. More info

Vehicle.getStatus(force)

Fetches and caches the car's status from the API. Can be forced. Returns an instance of VehicleStatus. More info

Acknowledgments

This work was inspired by the following repos:

Thank you for your efforts and hard work.

License

Disclaimer

This library is not affiliated nor endorsed by BMW Group / Bayerische Motoren Werke AG.