Advanced - Custom Server for Metadata

Hosting the metadata on your own server

This option is advanced and requires you to host the metadata on your own website/server using a specific URL.

When creating your store, you have the option to host the metadata on your own servers.

You might want to do this because:

  • You want to change the metadata periodically

  • Your project requires the metadata to be changeable

  • You want to control your data

  • You want to host your metadata on another platform outside of Mintable

Requirements

URL structure

The BaseURI is stored on the contract and every token uses it for the URL

Each token has a unique ID - such as token 1, token 2, token 3.

Each token will return a URL for the individual metadata of that token - so when you want the URL for token 3 - it will return: baseURI + token ID

If your baseURI is https://mywebsite.com/metadata/ then token 3 will return:

https://mywebsite.com/metadata/3

This is important to note: your baseURI must have a "/" at the end

good: "https://mywebsite.com/metadata/"

bad (won't work): "https://mywebsite.com/metadata"

Hosting the data

Once you have set up the baseURI, you will need to host the data on your server according to that baseURI. So if you set your URL as above "https://mywebsite.com/metadata/" and you make the first 5 tokens, tokens 1 - 5, you will need to host the metadata for each token at:

URL

TokenID

https://mywebsite.com/metadata/1

1

https://mywebsite.com/metadata/2

2

https://mywebsite.com/metadata/3

3

https://mywebsite.com/metadata/4

4

https://mywebsite.com/metadata/5

5

Creating the items

When you create a new item and list it for sale on the site - you will be shown the popup below. This will provide you the metadata you need to host on your server, in the format it should be hosted in.

You can change the "image:" field or any other field you'd like to change/add - but if you do - make sure you follow the NFT metadata standard

If you do not host this data at the https://baseURI/tokenID that you set - your token will not be displayed properly.

Tokens not displaying properly

To debug the situation - go to etherscan.io and look up your contract's address.

Go to the "read" tab on Etherscan for your contract so you can read the smart contract.

Type in the token ID for the field "tokenURI()" on Etherscan.

The URL returned here is where the metadata for this token needs to be hosted. If your URL is incorrect, or you have another issue and cannot host your metadata here - then you won't be able to see/display this token.

The baseURI you set must be correct.

Last updated