I'd like to send requests against the Google Directions API. Google provides a Node.JS client library for the API. However, this AP is server-side only. Attempting to use it from a browser script results in a CORS failure. Multiple past answers (such as this one) indicate that this library simply can't be used in this way.
The alternative is to use the client-side JavaScript API. However, this requires adding a <script>
tag to the document root. That's the wrong level of abstraction for my needs. I'd like to use a method from a library or dot-js
file instead.
Following the advice given here, I'd like to ask: is there a module available through npm
I can use to query the Google Directions API client-side?