# @thirdweb-dev/storage

> thirdweb Storage

Latest version **2.0.15** (published 2024-05-10) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @thirdweb-dev/storage
pnpm add @thirdweb-dev/storage
yarn add @thirdweb-dev/storage
bun add @thirdweb-dev/storage
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.15 |
| Published | 2024-05-10 |
| First published | 2022-08-22 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 4 |
| Unpacked size | 171.9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 639 |
| Author | thirdweb eng |
| Maintainers | furqantw, yash90, krishang, jakeloo, joaquim-verges, jnsdls |

## Links

- npm: https://www.npmjs.com/package/@thirdweb-dev/storage
- Repository: https://github.com/thirdweb-dev/js.git#main
- Homepage: https://github.com/thirdweb-dev/js/tree/main#readme
- Issues: https://github.com/thirdweb-dev/js/issues
- npm.io page: https://npm.io/package/@thirdweb-dev/storage

## Dependencies (4)

- [uuid](https://npm.io/package/uuid.md) ^9.0.1
- [cid-tool](https://npm.io/package/cid-tool.md) ^3.0.0
- [form-data](https://npm.io/package/form-data.md) ^4.0.0
- [@thirdweb-dev/crypto](https://npm.io/package/@thirdweb-dev/crypto.md) 0.2.6

## Recent versions

- 2.0.15 (latest) — 2024-05-10
- 2.0.0-next-7abd58d84-20240917032316 (next) — 2024-09-17
- 2.0.16-nightly-d974db533a5a2e241df7743b201d730c90cda0d7-20240627000603 (nightly) — 2024-06-27
- 0.0.0-dev-f95024147f012f9b752b6cd2215199dca870c39d-20240511003159 (dev) — 2024-05-11
- 0.2.8-pr19-9e6a4dc (pr19) — 2022-09-03
- 2.0.16-nightly-7be7b6ff84b83ee587d369f4e8da5a2d9f80b8c2-20240626221701 — 2024-06-26
- 2.0.16-nightly-3979ff0238ae9b3a0a216e6c2d562eb7206a9fe8-20240626085813 — 2024-06-26
- 2.0.16-nightly-e7434891354f351d2a399daebdddae9cf1fc817b-20240623000619 — 2024-06-23
- 2.0.16-nightly-fe775166d40fdd50faaa8d6da3fcd624f9a450ed-20240622000610 — 2024-06-22
- 2.0.16-nightly-d320777eea5404f596aa39b2b49b5165d3e1959a-20240621000551 — 2024-06-21
- 2.0.16-nightly-fab5cd43bed972b0a3f70f0f39a790349672ba72-20240620192731 — 2024-06-20
- 0.0.0-dev-bd03ffef9e57f12d9ceb57fa26c4c56781f381db-20240510221023 — 2024-05-10
- 2.0.15-nightly-ad24d83b5123f76b30268a755ff739a79f29f4af-20240510215849 — 2024-05-10
- 2.0.15-nightly-9d410c6a5409848fa6c7cc4f1c0fc6ec3a6fa6e8-20240510213648 — 2024-05-10
- 2.0.15-nightly-02c03196ad38de888ff86311c68fa010018bda60-20240510212518 — 2024-05-10
- … 786 more at https://npm.io/package/@thirdweb-dev/storage/versions

## README

<p align="center">
<br />
<a href="https://thirdweb.com"><img src="https://github.com/thirdweb-dev/js/blob/main/legacy_packages/sdk/logo.svg?raw=true" width="200" alt=""/></a>
<br />
</p>
<h1 align="center">thirdweb Storage</h1>
<p align="center">
<a href="https://www.npmjs.com/package/@thirdweb-dev/storage"><img src="https://img.shields.io/npm/v/@thirdweb-dev/storage?color=red&label=npm&logo=npm" alt="npm version"/></a>
<a href="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml"><img alt="Build Status" src="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml/badge.svg"/></a>
<a href="https://discord.gg/thirdweb"><img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/></a>

</p>
<p align="center"><strong>Best in class decentralized storage SDK for Browser and Node</strong></p>
<br />

## Installation

Install the latest version of the SDK with either `npm` or `yarn`:

```shell
npm install @thirdweb-dev/storage
```

```shell
yarn add @thirdweb-dev/storage
```

## Quick Start

Once you have the thirdweb Storage SDK installed, you can use it to easily upload and download files and other data using decentralized storage systems.

Here's a simple example using the SDK to upload and download a file from IPFS:

```jsx
import { ThirdwebStorage } from "@thirdweb-dev/storage";

// First, instantiate the SDK
const storage = new ThirdwebStorage();

// Now we can upload a file and get the upload URI
const file = readFileSync("path/to/file.jpg");
const uri = await storage.upload(file);

// Finally we can download the file data again
const res = await storage.download(uri);
const data = await res.text();
```

Alternatively, we can use the SDK to upload and download metadata and JSON objects, and we can also upload multiple items at once:

```jsx
// We define metadata for 2 different NFTs
const metadata = [
  {
    name: "NFT #1",
    description: "This is my first NFT",
    image: readFileSync("path/to/file.jpg"),
    properties: {
      coolness: 100,
    },
  },
  {
    name: "NFT #2",
    description: "This is my second NFT",
    image: readFileSync("path/to/file.jpg"),
    properties: {
      coolness: 200,
    },
  },
];

// And now we can upload it all at once to a single directory
const uris = await storage.uploadBatch(metadata);

// And easily retrieve the metadata
const metadata = await storage.downloadJSON(uris);
```

## Learn More

You can learn more about thirdweb and the Storage SDK with the following resources:

- [Storage Docs](https://portal.thirdweb.com/storage)
- [Thirdweb Twitter](https://twitter.com/thirdweb_)
- [Thirdweb Discord](https://discord.com/invite/thirdweb)

---
_Source: https://npm.io/package/@thirdweb-dev/storage · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
