IPFS.

Post

Share your knowledge.

IPFS moderator.
Mar 22, 2024
Expert Q&A

How to Use toGatewayURL to Save NFT Image URL for Image Component?

I am trying to utilize toGatewayURL to save the URL from an NFT image for use in an Image Component. However, I am unsure of what to specify as the gateway parameter in the function call. I have attempted to use hanlo.mypinata.cloud as the gateway, but it does not work. Additionally, I have a token available for use with the gateway. How can I correctly configure toGatewayURL with the appropriate gateway and token to save the NFT image URL?

  • IPFS
  • JavaScript
  • NFT.Storage
0
1
Share
Comments
.

Answers

1
IPFS moderator.
Mar 22 2024, 12:55

The library that provides the toGatewayURL function is NFT.storage. However, Pinata also offers extensive gateway information on their documentation page at https://docs.pinata.cloud/docs/gateways-page.

It appears that the toGatewayURL function requires a gateway URL and an IPFS CID to generate a functional URL. While using a generic gateway like "https://dweb.link/" should suffice, leveraging Pinata's dedicated gateways may offer better performance if you are already utilizing their services.

0
Official Answer
Comments
.

Do you know the answer?

Please log in and share it.

The InterPlanetary File System (IPFS) is a protocol, hypermedia and file sharing peer-to-peer network for storing and sharing data in a distributed file system.

95Posts95Answers
Sui.X.Peera.

Earn Your Share of 1000 Sui

Gain Reputation Points & Get Rewards for Helping the Sui Community Grow.

We use cookies to ensure you get the best experience on our website.
More info