How to only allow owners of a domain to use a particular avatar?

Hey guys,

I want to allow only the owners of particular subdomains to be able to use certain avatars (which I have uploaded as NFTs). However, the avatar url shows by default in the manager app.

My solution is to host the images on my own server, and then verify subdomain ownership when ENS makes a request, that way only the url to the api endpoint on my server shows.

I’d like to know what request ens manager makes to retrieve the images, and what I need to do to verify domain ownership before serving the images.

Thanks!

Your solution of hosting the images on your own server and verifying subdomain ownership seems acceptable.

I’d guess that the avatar images are just retrieved in the standard way using the graph, but you could also do a direct contract call or cache the data yourself.

Good luck!

Yes but doesn’t the ENS Manager app handle the call to get the image. How would I make that call (or atleast know what the call is so I can accordingly setup the server to check)?

Like I already said. You can get the avatar records using the graph, direct contract call or just index/cache the data yourself.

ethers.js has getAvatar function for getting the avatar record from a resolver

Will check it out! Thanks!