7.2.0 • Published 12 months ago

nft.storage v7.2.0

Weekly downloads
-
License
(Apache-2.0 OR MI...
Repository
github
Last release
12 months ago

nft.storage

Notice: Uploads have been decommissioned, and upload functionality in this package no longer functions, even with a valid API key. Please visit the product page to learn more and find a new hot storage provider for uploading new assets.

ci package styled with prettier size codecov

A client library for the https://nft.storage/ service. It provides a convenient interface for working with the Raw HTTP API from a web browser or Node.js and comes bundled with TS for out-of-the box type inference and better IntelliSense.

Install

Install the package using npm

npm install nft.storage

Or yarn

yarn add nft.storage

Usage

First, obtain an API token from https://nft.storage and use it in place of API_TOKEN below:

import { NFTStorage, File } from 'nft.storage'
const client = new NFTStorage({ token: 'API_TOKEN' })

async function main() {
  const metadata = await client.store({
    name: 'Pinpie',
    description: 'Pin is not delicious beef!',
    image: new File(
      [
        /* data */
      ],
      'pinpie.jpg',
      { type: 'image/jpg' }
    ),
  })
  console.log(metadata.url)
  // ipfs://bafyreib4pff766vhpbxbhjbqqnsh5emeznvujayjj4z2iu533cprgbz23m/metadata.json
}

main()

The client uses ESM modules. If running from Node.js, either name your script index.mjs or name it index.js and use npm init to create a new package.json file in your project directory, adding "type": "module", to it.

Run the script:

node index.mjs # or index.js

For more examples please see the API documentation or the examples directory in the project repository, which contains sample projects for both browsers and Node.js.

web3stash-testblockstor-testweb3store-test@dao-xyz/sdk-governance@infinitebrahmanuniverse/nolb-nf@everything-registry/sub-chunk-2271inferus-jschainwallet-client@uniblock/nft.storagetea-nft-lilyweb3stashweb3stash-test1store-directory@csir-dlt/afriverse@bladelabs/blade-sdk.jscyberfly-rip-db-serveripfs-storeipfsiolazy-ipfs-imagedroplinked-binancedroplinked-polygonstrapi-provider-upload-nft-storagestellar-nft.storage@araviel/nftst-metaplex-auth@aletheia-data/strapi-provider-upload-nft-storage@bcode-tech/bcode-sdk@buildship/hardhat-ipfs-upload@debased/contracts@dfdao/dynasty@dao-xyz/ipfs-pinning-adapter@dao-xyz/sdk-socialupload-to-ipfsupload3@hypercerts-org/hypercerts-sdk@fugitivesclub/nft@infte/web3-utils@infinixjoyd/metaplex-auth-service@infinixjoyd/nftstorage-auth@lorisleiva/js-uploader-nft-storage@lorisleiva/js-next-alpha@itheum/sdk-mx-data-nft@lxdao/uploader3@lxdao/uploader3-connector@neuralkit/ai-art-helper@network-goods/hypercerts-sdk@nftstorage/metaplex-auth@niftysave/followup@niftysave/storproc@metaplex-solarti/js-plugin-nft-storage@metaplex-foundation/umi-uploader-nft-storage@meteor-web3/utils@metaplex-foundation/js-plugin-nft-storage@moncici/ai_nft_generator@juicelabs/client@s2g/ipfs-pinning-adapter@s2g/social@rip-db/browser@rip-db/node@rip-db/server@onflow/freshmint@polysensus/chaintrap-arenastate@oasislabs/parcel-nfts@soramitsu/soraneo-wallet-web@stadium/player-cards@simpleweb/open-formatmusic-metadata-ipfsmobx-zod-form-storentent-archiveoluuponchain-magicocto-defi-nftnj_dmvnebulunft-clinft-storage-uploader-clinft-storage-uploader-libnft.storage-uploadernft-art-makernftcron_ft_nftnomoatpicgo-plugin-ipfs-nftstoragepod-uploadrip-db-jsramik32-2rebus.nftid.jslinearprotocolkyte-sdkmbo-sdk@vvv-interactive/nftanvil@web3-fullstack/layer-saas@xact-wallet-sdk/nft@zalastax/nolb-nf@stay.hungry07212/umi-uploader-nft-storage@tampham47/metaplex-authalgonftcf-identitycardano-nft-js-toolkitchia-minter-toolchia-nft-minterconsole-labs-upload-nft
7.2.0

12 months ago

7.1.1

2 years ago

7.1.0

2 years ago

7.0.3

2 years ago

6.3.0

3 years ago

6.4.1

3 years ago

6.4.0

3 years ago

7.0.0

3 years ago

6.1.0

3 years ago

6.2.0

3 years ago

6.0.2

3 years ago

6.0.1

3 years ago

5.1.3

4 years ago

5.1.2

4 years ago

5.1.1

4 years ago

5.1.0

4 years ago

5.2.5

3 years ago

5.2.4

3 years ago

5.2.3

3 years ago

5.2.2

3 years ago

5.2.0

3 years ago

6.0.0

3 years ago

5.0.0

4 years ago

3.4.0

4 years ago

4.0.1

4 years ago

4.0.0

4 years ago

3.3.0

4 years ago

3.2.2

4 years ago

3.2.0

4 years ago

3.1.3

4 years ago

3.1.2

4 years ago

3.1.1

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

1.4.0

4 years ago

2.0.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

1.3.1

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.9

4 years ago

0.3.10

4 years ago

0.3.8-alpha

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.8

4 years ago

0.3.7

4 years ago

0.3.4

4 years ago

0.3.0

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.3

4 years ago

0.2.0

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

0.0.0

4 years ago

0.0.0-dev

4 years ago