This is a basic wrapper for fetch() that we use to make authenticated requests back to the application server.
The code is distributed as ES modules, so it needs to be imported by an environment that support this, or transpiled, which is an exercise for you, my dear reader chum.