Skip to content

Commit 0d82d42

Browse files
committed
update README
1 parent 25b755e commit 0d82d42

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,38 @@ Visit our [official API documentation](https://docs.squarecloud.app/blob-referen
3232

3333
## Getting Started
3434

35+
- _Login and get your API Key at [https://squarecloud.app/account](https://squarecloud.app/account)._
36+
3537
```ts
3638
import { SquareCloudBlob } from "@squarecloud/blob"
37-
// const { SquareCloudBlob } = require("@squarecloud/blob");
39+
// CommonJS => const { SquareCloudBlob } = require("@squarecloud/blob");
3840

3941
const blob = new SquareCloudBlob("Your API Key")
4042
const objects = await blob.objects.list()
4143
```
4244

4345
### Creating an object
4446

47+
- _Check supported file types [here](https://docs.squarecloud.app/services/blob#supported-file-types)._
48+
4549
```ts
46-
const object = await blob.objects.put({ file: "path/to/file.png", name: "my_image" })
47-
console.log(object.url)
50+
const blobObject = await blob.objects.put({
51+
file: "path/to/file.png", // Absolute path to your file, Buffer or Blob
52+
name: "my_image.png" // File name with extension
53+
})
54+
55+
console.log(blobObject.url)
4856
```
4957

5058
### Deleting objects
5159

5260
```ts
53-
const objectsToDelete = ["ID/prefix/name1_xxx-xxx.zip", "ID/prefix/name_xxx-xxx-xxx.png"]
61+
// List of objects to delete (Limit of 100 per request)
62+
const objectsToDelete = [
63+
"ID/prefix/name1_xxx-xxx.mp4",
64+
"ID/prefix/name_xxx-xxx-xxx.png"
65+
]
66+
5467
await blob.objects.delete(objectsToDelete)
5568
```
5669

0 commit comments

Comments
 (0)