The example belows shows how we would upload an object called list-of-cats.txt to our buckets.
index.ts
Copy
import { StorageSyncClient } from "@storagesync/client";import fs from "fs";const client = new StorageSyncClient({ apiKey: "<YOUR_API_KEY>", bucket: "<YOUR_BUCKET_NAME>",});const data = fs.readfileSync("list-of-cats.txt");await client.putObject({ key: `list-of-cats.txt`, data: data,});// Now there should be a file called list-of-cats.txt in your bucket.