Published
Edited
Aug 27, 2021
1 fork
Insert cell
md`# Reproducible case for nft.storage client [#325](https://github.com/ipfs-shipyard/nft.storage/issues/325)`
Insert cell
attachment = FileAttachment("press F.png")
Insert cell
content = attachment.blob()
Insert cell
lib = import('https://cdn.skypack.dev/nft.storage')
Insert cell
file = new File([content], 'press F.png', { type: 'image/png' })
Insert cell
client = new lib.NFTStorage({
token: Secret("NFT_STORAGE_TOKEN")
})
Insert cell
token = client.store({
name: file.name,
description: `/Public/${file.name}`,
image: file,
xpic: file,
properties: {
more: file
}
})
Insert cell
token
Insert cell
token.url
Insert cell
token.embed()
Insert cell
token.embed().image.href
Insert cell
token.embed().xpic.href
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more