ci package styled with prettier size deps codecov

A client library for the 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 the package using npm

npm install

Or yarn

yarn add


First, obtain an API token from and use it in place of API_TOKEN below:

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

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


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.


View Github