But the drawback is the size of the resulting file. By default browserify is instructed by AWS to load a bunch of services when requiring the root module. Loading services one by one does not look like an easy option because of the way the API is built, but one can select the services to include (and their versions) in the bundle using environment variable
AWS_SERVICES as documented on the official page:
This still produces a very large package so in the end I might switch to smaller dependencies targetting specific services or even craft HTTP requests myself.
The second issue I encountered was
OPTIONS HTTP requests failing from the browser with
403 Forbidden. Those requests qre actually sent by S3 SDK prior to making actual API related requests to ensure that CORS is correctly configured for the current host. In my case I was missing allowed headers in my bucket. I thus set the following configuration: