Easily configure your own domain as a custom community handle for Bluesky using Cloudflare’s generous free tier.
Simple ATProto Handles allows you to use your domain as a handle on Bluesky, such as @name.example.com
, leveraging Cloudflare’s free tier. This is especially useful for communities and individuals who want a personalized, branded Bluesky handle.
This project uses:
Before starting 🏁, ensure you have Git and Node.js installed, as well as a domain for which you can manage DNS settings.
First, sign up for a Cloudflare account if you don’t have one. Create a D1 database and take note of the database name and Database ID
shown.
Add your domain to Cloudflare:
With Cloudflare configured, we can start setting up the project.
# Clone this repository
$ git clone https://github.com/fursudo/simple-atptoto-handles
# Enter project directory
$ cd simple-atptoto-handles
# Install dependencies
$ npm install
Next, rename .dev.vars.example
to .dev.vars
and fill in the values, including Bluesky account credentials (email
and password
).
Update the wrangler.toml
file with your Cloudflare database details:
name = "simple-atptoto-handles" # Edit as desired
[[d1_databases]]
binding = "DB"
database_name = "your-database-name" # Replace with your database name
database_id = "your-database-id" # Replace with your database ID
Cloudflare D1 databases exist in two states: local
and remote
. Start by applying migrations locally:
$ npx wrangler d1 migrations apply your-database-name --local
# Follow prompts to deploy 0001_db_init.sql
If everything is successful, start the project:
$ npm run dev
# Now let's make our changes to the remote database
$ npx wrangler d1 migrations apply your-database-name --remote
To version your project, you can push it to a GitHub repository. Run:
$ git add .
$ git commit -m "Initial commit"
$ git push
Avoid committing .dev.vars
to keep sensitive information secure.
Connect your GitHub repository to Cloudflare Pages from the Cloudflare dashboard.
Authenticate, then select your repository to build and deploy. Be Sure to Select the Qwik
Framework Preset.
In the Settings of your Cloudflare Page, add the Environment Variables and Secrets from your .dev.vars
file. Bind the D1 database to DB
, referencing your previously created database.
For custom domain support, navigate to Custom Domains in Cloudflare and add your domain (e.g., example.com
).
For DNS settings:
Add a wildcard CNAME
record with the name *
pointing to [your-page].pages.dev
.
For URL forwarding:
In Page Rules, set up a rule for *.example.com/*
with a Forwarding URL
(301 redirect) pointing to https://example.com/$1/$2
.
Your handle setup is now complete!
This project is licensed under GNU General Public License v3.0. For more details, see the LICENSE file.
Built with ❤️ & sleep deprivation by furSUDO
a collection of lightweight TypeScript packages for AT Protocol, the protocol powering Bluesky.
Use this repository to get started with your own Bluesky Labeler.
ATProto Feed Generator Starter Kit
AT Protocol Reference Implementation (TypeScript)
A dead simple client for subscribing to an ATProto Relay ("firehose").
A fully typed client for the Bluesky Jetstream (https://github.com/bluesky-social/jetstream) service.
Your Brand Here!
50K+ engaged viewers every month
Limited spots available!
📧 Contact us via email🦋 Contact us on Bluesky