7.1.1 • Published 10 months ago

nft.storage v7.1.1

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

nft.storage

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.storagegalofreshmintets-js-libraryevent-ticketing-system-js-libraryexexdripversedripverse-clidroplinked-binancedroplinked-polygonlinearprotocolipfsioipfs-storelazy-ipfs-imagekyte-sdknebulumusic-metadata-ipfsnomoatntent-archivemobx-zod-form-storenj_dmvonchain-magicpod-uploadpicgo-plugin-ipfs-nftstorageoluupramik32-2mbo-sdknft-storage-uploader-clinft-storage-uploader-libnft.storage-uploadernftcron_ft_nftnft-art-makernft-clirebus.nftid.jsrip-db-jsstrapi-provider-upload-nft-storagestore-directorytea-nft-lilyupload-to-ipfsupload3stellar-nft.storagevwbl-sdkweb3stash-test1web3stash@aletheia-data/strapi-provider-upload-nft-storage@bcode-tech/bcode-sdk@araviel/nftst-metaplex-auth@bladelabs/blade-sdk.js@dao-xyz/ipfs-pinning-adapter@dfdao/dynasty@debased/contracts@xact-wallet-sdk/nft@vvv-interactive/nftanvil@tampham47/metaplex-auth@zalastax/nolb-nf@buildship/hardhat-ipfs-upload@dao-xyz/sdk-social@csir-dlt/afriverse@fugitivesclub/nft@gooddollar/goodcollective-sdkdeeblue-apisdendria-core@hypercerts-org/hypercerts-sdk@nftstorage/metaplex-auth@network-goods/hypercerts-sdk@neuralkit/ai-art-helper@niftysave/followup@niftysave/storproc@onflow/freshmint@oasislabs/parcel-nfts@juicelabs/client@itheum/sdk-mx-data-nft@lorisleiva/js-next-alpha@lorisleiva/js-uploader-nft-storage@lxdao/uploader3@lxdao/uploader3-connector@rip-db/browser@rip-db/node@rip-db/server@moncici/ai_nft_generator@meteor-web3/utils@metaplex-foundation/js-plugin-nft-storage@metaplex-foundation/umi-uploader-nft-storage@metaplex-solarti/js-plugin-nft-storage@show-karma/karma-gap-sdk@simpleweb/open-format@s2g/ipfs-pinning-adapter@s2g/social@polysensus/chaintrap-arenastate@infte/web3-utils@solana-suite/spl-token@solana-suite/storage
7.1.1

10 months ago

7.1.0

12 months ago

7.0.3

1 year ago

6.3.0

2 years ago

6.4.1

2 years ago

6.4.0

2 years ago

7.0.0

2 years ago

6.1.0

2 years ago

6.2.0

2 years ago

6.0.2

2 years ago

6.0.1

2 years ago

5.1.3

2 years ago

5.1.2

2 years ago

5.1.1

2 years ago

5.1.0

2 years ago

5.2.5

2 years ago

5.2.4

2 years ago

5.2.3

2 years ago

5.2.2

2 years ago

5.2.0

2 years ago

6.0.0

2 years ago

5.0.0

2 years ago

3.4.0

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

3.3.0

3 years ago

3.2.2

3 years ago

3.2.0

3 years ago

3.1.3

3 years ago

3.1.2

3 years ago

3.1.1

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

1.4.0

3 years ago

2.0.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

1.3.1

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.9

3 years ago

0.3.10

3 years ago

0.3.8-alpha

3 years ago

0.3.6

3 years ago

0.3.5

3 years ago

0.3.8

3 years ago

0.3.7

3 years ago

0.3.4

3 years ago

0.3.0

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.3

3 years ago

0.2.0

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago

0.0.0-dev

3 years ago