Demo: verify a domain handle on Bluesky via the HTTP/non-DNS method with Astro

View on Github or read the blog

If you navigate to /.well-known/atproto-did you'll be served plain text that reads did:plc:yourDIDhere. This is achieved with an Astro static file endpoint.

            
import type { APIRoute } from "astro";

export const GET: APIRoute = () => {
    return new Response("did:plc:yourDIDhere");
};
            
        

Update the src/pages/.well-known/atproto-did.ts file with your own DID, build the site and deploy it somewhere (I like Netlify). Then you'll be able to verify your custom domain handle on Bluesky with the HTTP method!

This demo might be useful if you don't have access easy access to the DNS records of your site or subdomain. You may not even want to maintain a website there, you can just use this to bootstrap the domain authentication! For example, my bot project @helveticabot.jacklorusso.com is on a subdomain of my website, but doesn't really need a web presence.

For more information read 'How to set your domain as your handle' on the Bluesky blog.

@jacklorusso.com