It is possible to monitor vehicles with gps in application of api JS arcgis
Not sure I understand the question, but if you are talking about showing realtime vehicle locations in a web map? Here is a sample using a stream layer, but you'd need to have GeoEvent or Velocity to stream the vehicle locations:
https://developers.arcgis.com/javascript/latest/sample-code/layers-streamlayer/