Access Storage with AWS S3 SDKs


CloudBit Object Storage is an S3-compatible object storage service that lets you store and serve large amounts of data.

The CloudBit Object Storage API is inter-operable with the AWS S3 API, meaning you can use existing S3 tools and libraries with Spaces. A common use case is managing CloudBit Object Storage programmatically with AWS’ S3 SDKs.

Install the SDK

Install the AWS SDK using the package manager for your language of choice.

npm install aws-sdk

Obtain Access & Secret Keys

You are able to retrieve the access & secret keys in our customer portal:

The examples below rely on environment variables to access these keys. Export ACCESS_KEY and SECRET_KEY to your environment (e.g. export ACCESS_KEY=DSJE2334JAS) to make them available to your code.


After you set up and configure an SDK, you can follow the examples below to see how to perform common CloudBit Object Storage operations in JavaScript, Go, PHP, Python and Ruby.

const AWS = require('aws-sdk');
const fs = require('fs'); // Needed for example below

const spacesEndpoint = new AWS.Endpoint('<S3-ENDPOINT>');
const s3 = new AWS.S3({
    endpoint: spacesEndpoint,
    accessKeyId: process.env.ACCESS_KEY,
    secretAccessKey: process.env.SECRET_KEY

Please replace the <ENDPOINT> place holder with the correct endpoint: Location BIT1:

Last updated