Read my blog about this
If you clone or fork this repo, inside of your project you'll see the following folders and files:
/
โโโ public/
โโโ src/
โ โโโ pages/
โ โโโ .well-known
โ โ โโโ atproto-did.ts
โ โโโ index.html
โโโ package.json
If you run the build and 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.
Thanks! โ @jacklorusso.com
All commands are run from the root of the project, from a terminal:
Command | Action |
---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:4321 |
npm run build |
Build your production site to ./dist/ |
npm run preview |
Preview your build locally, before deploying |
npm run astro ... |
Run CLI commands like astro add , astro check |
npm run astro -- --help |
Get help using the Astro CLI |
Feel free to check the Astro documentation.