npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

connected-car

v1.3.0

Published

![ConnectedCar Node SDK Logo](https://user-images.githubusercontent.com/35158392/147300580-29723aab-ffae-46d3-ae60-72af59065daa.png)

Downloads

7

Readme

ConnectedCar Node SDK Logo

The ConnectedCar JavaScript SDK is an open-source, python package that provides the ability to send commands to your Ford Sync Connect (Ford Pass) connected vehicle.

Installation

npm install connected-car

Requirements

  • To make requests to a vehicle, the end user must have signed up for an account using Ford Pass. These credentials will be used to authenticate your requests.

Getting Started

Import the ConnectedCar SDK

import connectedcar from 'connected-car';

Create a new connectedcar client

  • Note the default ConnectedCar client_id is 9fb503e0-715b-47e8-adfd-ad4b7770f73b
const client = connectedcar.AuthClient('9fb503e0-715b-47e8-adfd-ad4b7770f73b', {region: 'US'}); // Region argument is only required if you live outside the United States.
  • Note: If your region is outside of the US you can pass different region parameters to the User class. Regions: (US, CA, EU, AU)

Use client.getAccessTokenFromCredentials() to exchange your user credentials for an token object. To make any vehicle data request to the Ford Sync Connect API, you'll need to give the SDK a valid access token.

const token = await client.getAccessTokenFromCredentials({
  username: '<username>',
  password: '<password>',
});

Access tokens will expire every 2 hours, so you'll need to constantly refresh them by calling client.getAccessTokenFromRefreshToken()

const refreshToken = await client.getAccessTokenFromRefreshToken(token.getRefreshToken());

With your access token in hand, use connectedcar.User() to get a User object representing the user.

const user = connectedcar.User(token.getValue());

Use user.vehicles() to return an array of all the vehicles associated with a users account. The response will include the vehicle vin.

const vehicles = await user.vehicles();

const vehicleList = []; // Array of vehicles

for (userVehicle of vehicles) // For each user vehicle
  vehicleList.push(userVehicle['VIN']);

Now with a vehicle vin in hand, use connectedcar.Vehicle() to get a Vehicle object representing the user's vehicle.

let currentVehicle = connectedcar.Vehicle(vehicleList[0], token.getValue());

Now you can ask the car to do things, or ask it for some data! For example:

await currentVehicle.start();

Examples & Documentation

For more examples on what you can do with your ConnectedCar, see the examples folder or take a peek at the documentation.

Funding & Support

If you are interested in supporting the development of my projects check out my patreon or buy me a coffee.

Disclaimer

THIS CODEBASE IS NOT ENDORSED, AFFILIATED, OR ASSOCIATED WITH FORD, FOMOCO OR THE FORD MOTOR COMPANY.