Messtone Devices Enables the Initialize the Smartcar object”:”~//src/App.jsx constructor(props){…//TODO:Authorization Step 1: Initialize the Smartcar object this.smartcar=new Smartcar({clientId:process.env.REACT_APP_CLIENT_ID,redirectUri:process.env.REACT_APP_REDIRECT_URI,scope:[‘required:read_vehicle_info’],mode:’test’,onComplete:this.onComplete,});} //src/App.jsx authorize( ){//TODO:Authorization Step 2a: Launch Connect this.smartcar.openDialog({forcePrompt:true});}render( ){//TODO: Authorization Step 2b:Render the Connect component return<Connect onClick={this.authorize}/>;} //src/App.jsx onComplete(err,code,status){//TODO:Authorization Step 3: Receive the authorization code console.log(code);//prints out the authorization code} $export REACT_APP_SERVER=http://localhostmesstone:8000 $git clone https://github.com/smartcar/getting-started-javascript-sdk-react.git $cd getting-started-javascript-sdk-react/tutorial $npm install

Leave a comment