Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Upload Your First File (3 minutes)

Basic Upload Pattern

import { Pinner } from "@lumeweb/pinner"; const pinner = new Pinner({ jwt: "YOUR_API_TOKEN" }); const file = new File(["Hello, Pinner!"], "hello.txt", { type: "text/plain" }); const result = await pinner.uploadAndWait(file); console.log("CID:", result.cid); console.log("Name:", result.name); console.log("Size:", result.size, "bytes");
Expected output:
Uploaded CID: bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq
Gateway URL: https://bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq.ipfs.dweb.link
Size: 154 bytes
Time: 0.123s

Verify it worked

pinner status bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq

Pinata Migration →  Reference Docs →