Building NFTs for Artists & Their Fans
NFTs can be a great way for artists to sell their work and connect with collectors. By using Underdog and Sphere, you can create a seamless and secure way for artists to mint their NFTs and sell them to buyers.
Here are the steps involved in creating a gallery for artists to sell their art using Underdog and Sphere:
- Create an Underdog account and mint an NFT for each piece of art.
- Create a product in Sphere for each NFT.
- Set up webhooks between Underdog and Sphere so that whenever an NFT is minted, a new product is created in Sphere.
- Enable users to pay with USDC or Solana for NFTs and mint it into a users wallet.
Once you have completed these steps, you will have created a gallery where artists can sell their art to buyers.
Need something more like GitHub? Here’s the template that you can follow:
Quick Start
- Install dependencies
yarn
- Run the development server
yarn dev
Webhook Setup
You can run the setup script to automatically generate webhooks on both Underdog and Sphere.
yarn run setup
Note: you'll need to have your Underdog API key and Sphere API key, set your network, and set the app URL in your environment variables.
Otherwise, you can use the interface to manually create webhooks.
Underdog
- Go to https://app.underdogprotocol.com/webhooks
- Click Add Webhook
- Set URL to ${APP_URL}/api/underdog/webhooks and select project.create
Sphere
- Go to https://spherepay.co/dashboard/developers/webhooks
- Click Create Webhook
- Set URL to ${APP_URL}/api/sphere/webhooks and select Payment Successful
Environment Variables
VariableDescriptionExampleAPP_URL: The URL of the app used to redirect after a successful payment on the Sphere checkout pagehttps://gallery.underdogprotocol.com
NEXT_PUBLIC_APP_NAME: The name of the app used in the headerUnderdog GalleryNEXT_PUBLIC_NETWORKEither MAINNET for Solana mainnet-beta or DEVNET for Solana devnet
DEVNETUNDERDOG_API_KEYKey: to authenticate your Underdog requests generated from https://app.underdogprotocol.com/apikeys1cc491851db99d.aasdfasdf342423524531242
SPHERE_API_KEYKey: to authenticate your Sphere requests generated from https://spherepay.co/dashboard/developers/api-keyssecret_aasdfasdf342423524531242
SPHERE_WEBHOOK_SECRET: Secret to validate webhook requests sent from Spheresecret_123dsafdsafadsf