andrewrk / node-s3-client

high level amazon s3 client for node.js
MIT License
1k stars 303 forks source link

Custom endpoint #233

Open Jimbly opened 4 years ago

Jimbly commented 4 years ago

With Backblaze releasing an S3-compatible API, I've found the need to specify a custom endpoint on some of my "S3" connections. It looks like nothing in particular is exposed, but was able to get it to work with this code, sharing in case others find this useful:

const s3 = require('@auth0/s3');

let client = s3.createClient({
  s3Options: {
    'accessKeyId': '...',
    'secretAccessKey': '...',
    'region': 'us-west-001',
    'endpoint': 's3.us-west-001.backblazeb2.com',
  },
});

Would be nice to have a little documentation in the README on what can go into s3Options, I tried following the link, and it was pretty indecipherable, had me doing a bunch of new s3.AWS.Endpoint(endpoint) stuff that, though worked, apparently was not necessary!