By default, scripts can use fetch() to talk to any HTTP endpoints.
Extending your script's global context
To make it easier for users to access your own or other product's APIs, you'll likely want to inject a pre-configured client into the global scope of your script's global context.
As you might have noticed, you can also provide some static data to your script's global context, simply by setting the property global on your request options.
Configure pre-authenticated HTTP calls for specific domains
On top of providing your own custom client or helper functions to your script's global context, you can also make requests to be "magically" authenticated without risking the authentication token being extracted by a malicious script.
Here's the above example, but with extra fetchCredentials configured for api.jsonbin.io.