The original version of this story was published on the Sentry blog.
Buckle up! On this episode of Exception Perceptions, Sydney Palumbo and Emre Sonmez, engineers at Smartcar, drove by to chat about Smartcar, a platform that helps developers create apps that communicate with vehicles. Watch the episode, and then shift gears to let Sydney and Emre guide you through Smartcar’s delightfully simple process.
What is Smartcar?
Smartcar is a standard API for connected vehicles. We enable web and mobile app communication with cars (think “lock doors” or “check odometer”) across multiple brands, without any hardware.
So what does that actually mean?
Let’s say you wanted to build a simple iOS app to share your car keys with your friends. Here’s how you’d do that:
- Register your application on the Smartcar developer dashboard.
- Add a “Connect your car” button to your app.
- When your users click the button, they will authenticate with their cars using the Smartcar authorization flow, fortunately using the same credentials they would for their car’s mobile app (e.g. Tesla app, Lexus Enform app).
- After this authentication is complete, your app receives a token that can be used to make HTTP requests to the car via the Smartcar API.
- Success! Your users now have access to a digital key to their vehicle that they can use for keyless entry, or to share with their friends!
What could possibly go wrong
Now, this is how things should work. But as we all know, things can go wrong. And when things go wrong, we want to quickly resolve the issue to keep our developers happy. Here’s where Sentry comes in.
Connecting to vehicles
When someone makes an API request to us (to get a vehicle’s location, for example), we figure out what brand and model the car is and retrieve that data point from the car using our integrations with car brands. A lot could happen when we attempt to retrieve this info:
- The car could be offline (e.g. in an area with no cell reception).
- The car manufacturer’s infrastructure could be experiencing problems.
- There could be an issue with the Smartcar service.
These types of issues are to be expected with large, complex, moving objects. However, if any of these three things occur, our process is to (a) investigate the issue as soon as possible, (b) notify our developers that have been affected if the issue is severe, and (c) resolve the issue.
When an error occurs, Sentry provides us the stack trace, release, car brand, and source of the request — which allows our team to investigate, resolve, and notify developers of the issue as fast as possible.
Managing your application
When you first create a developer account (for example, to run our demo app), we generate a client ID and secret for your application. This process is a necessary step to make your first request to the Smartcar API. If a developer experiences an error in our React app while registering their application or updating their configuration, we want to identify who the user is and make sure they can successfully use our API as soon as possible.
At Smartcar, we focus heavily on minimizing the time it takes for a developer to log in to our dashboard, register an application, and make their first request to our API. Sentry enables us to quickly detect errors and see the actions the user took that lead to the error.