JavaScript and Node.js
The AWS SDK for JavaScript v3 (@aws-sdk/client-s3) works with Zata. Point the client at the Zata endpoint, and you can use the normal S3 commands from Node.js.
Before you start
-
A bucket. See Create a bucket.
-
An access key and secret key from the same region as the bucket. See Access keys.
-
Node.js with the SDK installed:
You need
@aws-sdk/s3-request-presigneronly for download and upload links.
Connection settings
Create the client
Keep your keys out of the code. Put them in the environment variables ZATA_ACCESS_KEY and ZATA_SECRET_KEY, then create the client. For a bucket in Mumbai, use https://bom01.zata.ai.
The two checksum settings are needed from SDK version 3.729 (January 2025): without them, large uploads fail with XAmzContentSHA256Mismatch.
The examples on this page use ES modules (import) and top-level await: save them in a .mjs file, or set "type": "module" in package.json.
Upload and list files
Download a file
List your buckets
A sub-user’s key gets an empty list here, even for buckets it can use. Use the bucket name directly.
Make a download or upload link
A presigned URL lets someone download or upload one file without keys, until the link expires. expiresIn is in seconds.
If you set a ContentType in the PutObjectCommand, the upload must send exactly that Content-Type header, or Zata answers 403. Anyone who has a link can use it until it expires, so share it only with the intended person.
Troubleshooting
Never set NODE_TLS_REJECT_UNAUTHORIZED=0: Zata’s certificates are valid. For other errors, see Large uploads and Wrong endpoint or region.