Skip to content

Instantly share code, notes, and snippets.

@dmulvi
Created February 9, 2024 20:15
Show Gist options
  • Save dmulvi/68f75d13d6fb73f2184809639555f8b1 to your computer and use it in GitHub Desktop.
Save dmulvi/68f75d13d6fb73f2184809639555f8b1 to your computer and use it in GitHub Desktop.
Mint an NFT with Crossmint
const options = {
method: "POST",
headers: {
"X-API-KEY": "YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
metadata: {
name: "Crossmint NFT #1",
description: "Awesome NFT #1",
image: "ipfs://QmVhAkiT3XCPQUaZKHootfEfixmKVqSiq5Y7uVPZyFGQXw",
},
recipient: "email:testy@test.xyz:polygon",
}),
};
const baseUrl = "https://staging.crossmint.com/api";
const collectionId = "YOUR_COLLECTION_ID";
fetch(`${baseUrl}/2022-06-09/collections/${collectionId}/nfts`, options)
.then((response) => response.json())
.then((response) => console.log(response))
.catch((err) => console.error(err));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment