Providers
Providers encapsulate all functionality and features of the Dealermesh Platform and manages them on your behalf. It is responsible for initializing the required configurations and maintain state. You will need to use these providers to wrap your UI to use this package.
DMProvider
This is the main provider, which will initialize the context for Dealermesh. You need to add this provider at the root level of your UI.
Attributes:
clientId
Yes
The app client ID.
accessToken
Yes
The access token of your app.
accessKey
Yes
The app's access key for your dealer.
vin
Yes
The VIN number of the vehicle
Example:
import {DMProvider} from "@dealermesh/react";
const dmConfig = {
clientId: "the-client-id-of-the-app",
accessToken: "YzdmMjM5YzItODhhZS00MD...5NDVkMmNmNGVlLTE",
accessKey: "your-dealer-access-key",
vin: car.vin
}
<DMProvider config={dmConfig}>
... your code here
</DMProvider>DMDRProvider
This provider initializes and manages the Digital Retailing related components.
Attributes:
vin
Yes
The VIN number of the vehicle
msrp
Yes
The MSRP of the vehicle
price
Yes
The selling price of the vehicle
year
Yes
The year of the vehicle
make
Yes
The make of the vehicle
model
Yes
The model of the vehicle
trim
Yes
The trim of the vehicle
Example:
Note: The DMDRProvider should always be embedded inside the DMProvider
Last updated