Getting Started

Setup

Before we get started building our web application, we need to complete a few setup steps -

  1. Sign Up For a Smartcar Account - Sign up for your Smartcar developer account
  2. Retrieve Your API Credentials - Retrieve your API credentials so you can make requests to Smartcar
  3. Configure Your Redirect URI - Configure your application's redirect URI
  4. Clone a Starter Kit - Clone a starter kit so you can follow along with the rest of the guide

Step 1: Sign Up For a Smartcar Account

Go to our Developer Dashboard to sign up with Smartcar.

Step 2: Retrieve Your API Credentials

Once you log in, you will see the API credentials for your application. You will need the Client Id and Client Secret credentials to complete this tutorial.

Step 3: Configure Your Redirect URI

You will need to set a redirect_uri for your application. This represents the location of where your application is hosted. Register the following as a redirect uri for your application: http://localhost:8000/exchange. We will be using this in the next section.

Step 4: Clone a Starter Kit

Now that you have your application registered, clone a starter kit for the language of your choice to get started. In the cloned repository, you will find the Smartcar SDK installed and a simple server set up.

  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
git clone https://github.com/smartcar/getting-started-node-sdk.git
cd getting-started-node-sdk/tutorial
npm install

You will also have to set the following environment variables -

  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
  • $
export CLIENT_ID=<your-client-id>
export CLIENT_SECRET=<your-client-secret>
export REDIRECT_URI=http://localhost:8000/exchange
Note: If you are using Windows, ensure you are appropriately setting environment variables for your shell. Please refer to this post which details how to set environment variables on Windows.

Now that we've set up our application, let's learn more about Smartcar's authorization flow.