Currently there's single global state which stores the user account details and connection token. This means that you can't access trackers for multiple users.
If instead the module exported a client that could be initialised, then credentials could be held within that object:
import { Client } from 'tractive'
const client = new Client('username', 'password')
await client.getTrackers()
const client2 = new Client('username2', 'password2')
await client2.getTrackers()
It would be possible to maintain the current api alongside if desirable (maybe with a deprecated notice?)
Currently there's single global state which stores the user account details and connection token. This means that you can't access trackers for multiple users.
If instead the module exported a client that could be initialised, then credentials could be held within that object:
It would be possible to maintain the current api alongside if desirable (maybe with a deprecated notice?)