
There's no dedicated AIOZ Storage JavaScript package to install. The AIOZ storage javascript sdk is the standard AWS SDK for JavaScript v3, @aws-sdk/client-s3, pointed at a different endpoint with one extra config flag. This quickstart covers the exact client setup AIOZ's own SDK documentation specifies, then uploading, listing, and downloading objects with it.
TL;DR:
@aws-sdk/client-s3, the same package used against Amazon S3 itself, no AIOZ-specific package exists or is needed.region: 'us-east-1', a custom endpoint, and forcePathStyle: true as the required client config.forcePathStyle is not optional boilerplate, without it the SDK tries virtual-hosted-style URLs that don't resolve against AIOZ Storage's single endpoint.No, and that's by design, not a gap. AIOZ Storage's S3-compatible API works directly with @aws-sdk/client-s3, the same official AWS SDK package used against Amazon S3. Install it with npm install @aws-sdk/client-s3, there's nothing AIOZ-specific to add on top.
AIOZ's own SDK documentation specifies this exact configuration:
import { PutObjectCommand, S3Client } from '@aws-sdk/client-s3'
const s3Client = new S3Client({
region: 'us-east-1',
credentials: {
accessKeyId: 'YOUR_ACCESS_KEY_ID',
secretAccessKey: 'YOUR_SECRET_ACCESS_KEY'
},
endpoint: {
url: 'https://s3.aiozstorage.network'
},
forcePathStyle: true
})Two settings matter more than the others here. region: 'us-east-1' is required by the SDK's constructor even though AIOZ Storage isn't region-partitioned, the same placeholder-region pattern AIOZ's Python SDK docs use too. And forcePathStyle: true isn't optional: without it, the SDK defaults to virtual-hosted-style requests (bucket.endpoint/key), which don't resolve against AIOZ Storage's single endpoint the way they do against AWS's per-region S3 endpoints. Leave it out and every request fails before it gets anywhere near your bucket.
async function uploadFile(bucket, key, body) {
const command = new PutObjectCommand({
Bucket: bucket,
Key: key,
Body: body,
})
return s3Client.send(command)
}
await uploadFile('your-bucket', 'hello.txt', 'Hello from AIOZ Storage')Every operation in the v3 SDK follows this same command-object pattern: build a Command with the parameters, pass it to s3Client.send(). Body accepts a string, a Buffer, or a readable stream, whatever shape your data is already in, without needing to convert it first.
import { ListObjectsV2Command, GetObjectCommand } from '@aws-sdk/client-s3'
async function listFiles(bucket) {
const command = new ListObjectsV2Command({ Bucket: bucket })
const response = await s3Client.send(command)
return (response.Contents || []).map(obj => obj.Key)
}
async function downloadFile(bucket, key) {
const command = new GetObjectCommand({ Bucket: bucket, Key: key })
const response = await s3Client.send(command)
return response.Body.transformToString()
}response.Body in the v3 SDK is a web stream, not a plain string, which is why downloadFile calls .transformToString() on it. If you're downloading binary data instead of text, transformToByteArray() does the same job for a Uint8Array instead.
import { DeleteObjectCommand } from '@aws-sdk/client-s3'
async function deleteFile(bucket, key) {
const command = new DeleteObjectCommand({ Bucket: bucket, Key: key })
return s3Client.send(command)
}Same pattern as every other operation: build the command, send it. Like the S3 API generally, a delete against a key that doesn't exist still resolves successfully rather than throwing, so this won't tell you whether the file was actually there before you deleted it.
Every s3Client.send() call can reject, a missing bucket, an expired credential, a network failure, and the v3 SDK throws a typed ServiceException you can catch and inspect:
import { S3ServiceException } from '@aws-sdk/client-s3'
try {
await s3Client.send(command)
} catch (error) {
if (error instanceof S3ServiceException) {
console.error(`S3 error: ${error.name} - ${error.message}`)
} else {
throw error
}
}error.name gives you the specific error code (NoSuchKey, NoSuchBucket, AccessDenied, and so on), the same information boto3 surfaces through its own exception classes on the Python side of this SDK family.
What npm package do I need for the AIOZ Storage JavaScript SDK?@aws-sdk/client-s3, the standard AWS SDK for JavaScript v3. No separate AIOZ-specific package exists.
Why does the S3Client need forcePathStyle: true for AIOZ Storage?
Without it, the SDK defaults to virtual-hosted-style request URLs (bucket.endpoint/key), which don't work against AIOZ Storage's single endpoint. forcePathStyle switches requests to endpoint/bucket/key instead.
Why does the client need a region if AIOZ Storage isn't region-partitioned?
The SDK's constructor requires a region value regardless of target. AIOZ's own documentation sets it to us-east-1 as a placeholder.
What does response.Body look like when downloading with the v3 SDK?
A web stream, not a plain string or Buffer. Call .transformToString() for text or .transformToByteArray() for binary data.
Does uploading with PutObjectCommand accept a file stream, or only a string?
Both, and a Buffer too. Body accepts whatever shape your data is already in without requiring a conversion step first.
How do I catch and identify S3 errors in the JavaScript SDK?
Catch S3ServiceException, the SDK's base error class for service errors, and check error.name for the specific error code (NoSuchKey, NoSuchBucket, AccessDenied, and similar).
Does deleting a nonexistent key throw an error?
No. Like the S3 API generally, DeleteObjectCommand resolves successfully even if the key was never there, so it won't tell you whether anything was actually deleted.
Is the JavaScript SDK setup different from the Python (boto3) setup?
Same underlying pattern, different syntax: both need a custom endpoint pointed at AIOZ Storage and a path-style addressing flag (forcePathStyle in JS, addressing_style: path in boto3's Config).

Automatic MIME type detection on AIOZ Storage uses Google Magika to identify a file's type from its content when Content-Type is missing. How it actually works.

The AIOZ storage developer platform in one place: three SDKs, a CLI, direct API access, two migration paths, and the one config pattern tying it all together.

The 3-2-1 backup rule: three copies, two media, one off-site. Why it still holds up, why ransomware forced a 3-2-1-1-0 update, and where AIOZ Storage fits.

RBAC vs ABAC vs capability-based access control: three different answers to who can do what. NIST defines the first two, AIOZ Storage macaroons are the third.

What is a CDN: a network of cached servers placed near users to cut latency. How it sits in front of an origin like S3, and where AIOZ Storage fits in.

Hot vs cold storage: hot tiers cost more to store but less to access, cold tiers flip that trade. How AWS and Azure structure it, and where AIOZ Storage fits.