Setup the JavaScript SDK
Install the aws-sdk package using your preferred package manager. Here at Internxt, we usually use yarn:
yarn install aws-sdk
Setup the codebase
This codebase uses the us-central-1 zone, you may want to use other available zones that can be found here.
const { S3, Endpoint } = require('aws-sdk');
const endpoint = new Endpoint('https://s3.us-central-1.internxt.com');
const accessKeyId = process.env.S3_ACCESS_KEY_ID;
const secretAccessKey = process.env.S3_SECRET_ACCESS_KEY;
const region = 'us-central-1';
const s3 = new S3({
endpoint,
credentials: {
accessKeyId,
secretAccessKey,
},
region,
s3ForcePathStyle: true,
});If you run into any problems or concerns, please don’t hesitate to contact us for support at [email protected]