Generate an API Key and add at least 1 RedirectUri (you'll need these later, along with your Client ID).
2
Install the SDK
npm install @dimo-network/data-sdk
# Or install with yarn
yarn add @dimo-network/data-sdk
pip install dimo-python-sdk
# Windows users:
Install-Package Dimo.Client
# Mac/ Linux users:
dotnet add package Dimo.Client
3
Import + Initiate the SDK
Import the SDK:
# ES Modules:
import { DIMO } from '@dimo-network/data-sdk';
# Or Common JS
const { DIMO } = require('@dimo-network/data-sdk/dist/index.cjs';
Initiate the SDK depending on the environment of your interest. We currenty support both Production and Dev environments, but recommend using Production at this time.
const dimo = new DIMO('Production');
# or
const dimo = new DIMO('Dev');
Import the SDK:
from dimo import DIMO
Initiate the SDK depending on the environment of your interest. We currenty support both Production and Dev environments, but recommend using Production at this time.
Use the credentials from your Developer Console application (Step 1) to obtain a Developer JWT, and a Vehicle JWT for vehicle tokenIds that have shared privileged vehicle access with you. You can learn more about these in Authentication.
The domain value is any of the configured redirectUri's you've added in the console.
The private_key value is the API Key you generated.
# Call to get a Vehicle JWT
get_vehicle_jwt = dimo.token_exchange.exchange(
developer_jwt = dev_jwt,
privileges=[1, 3, 4, 5],
token_id=<token_id>
)
# Store the Vehicle JWT from the get_vehicle_jwt response
vehicle_jwt = get_vehicle_jwt['token']