$ yarn add bmwcd.js
$ npm install bmwcd.js
import ConnectedDrive from 'bmwcd.js'
import dotenv from 'dotenv/config'
(async () => {
const bmwcd = await new ConnectedDrive(process.env.BMW_USERNAME, process.env.BMW_PASSWORD)
const vehicle = await bmwcd.getVehicle(process.env.BMW_VIN)
console.log(await vehicle.status())
})()
const { ConnectedDrive } = require('bmwcd.js')
const main = async () => {
// ConnectedDrive account authentication
const bmwcd = new ConnectedDrive(username, password)
// Select vehicle by VIN and output status object
const vehicle = await bmwcd.findVehicle('WBAXXXXXXX1234567')
console.log(await vehicle.status())
}
main()
Inspired by connected_drive.js and bimmerconnected (python).