This outlines how I usually implement external service calls on the frontend. We use classes and leverage advantages to craft a compact and easily portable way to make API calls. Note that this could absolutely be done with functions, but I created this gist out of demand.
GitHub gist is just annoying and doesn't line up the files as you create them. Instead it orders it alphabetically. When I have time, I'll fix it. For now, manage it as it is.
Note: Treat hyphen (-
) in file names as a directory slash (/
).