Have you checked examples that we provide in the repo?
https://github.com/traccar/traccar-web/blob/master/web/simple/app.js
I've been testing the example and it throws me these errors in the browser console:
GET http://xxx.xxx.xxx.xxx:8082/api/session?token=undefined 404 (Not Found)
Uncaught SyntaxError: Unexpected token H in JSON at position 0
I think that the token is obtained once you log in correctly, but in the example code it nowhere appears where one can set the session credentials.
Please if you could guide me ...
I would recommend you read and understand what the code does. It should answer your questions.
Is there an example of a websocket connection with javascript?
I have checked the forum and I have not found it ...