···44service.
5566It omits some features like signatures and support for the `queryLabels` endpoint,
77-but seems to work just fine with the native bsky.app web and iOS app.77+but seems to work just fine with the native bsky.app web and iOS app.
88+99+The idea behind this is to be simple and avoid the complexity present in full
1010+featured labelers, which include a database and a full server that responds to
1111+HTTP requests. I hope you can use this as a good starting point, it should be
1212+fairly easy to translate it to other languages/frameworks too if necessary.
1313+1414+The below sections explain how to set up your account as a labeler and how to
1515+deploy this worker. These steps are fairly simple and you should have a working
1616+within 5 minutes.
1717+1818+## Account setup
1919+2020+1. Create a new Bluesky account (do not reuse a personal account for this!)
2121+2. Run `npx @skyware/labeler setup` and follow the wizard to convert that account into a labeler
2222+3. The URL of the labeler will be `https://bsky-labeler.<YourUsername>.workers.dev/`.
2323+4. The label we use in this example is `verified-human`. You can easily change this though.
2424+2525+## Worker deployment
2626+2727+Once your account is set up properly, you can deploy your worker by running
2828+`wrangler deploy` in this repo's directory.
2929+3030+## Testing the labeler
3131+3232+You should then be able to test your new labeler by subscribing to it (just go
3333+on its profile), then if you view the profile for bsky.app you should see
3434+the new label.
+1-104
wrangler.toml
···88# Docs: https://developers.cloudflare.com/workers/observability/logs/workers-logs/
99# Configuration: https://developers.cloudflare.com/workers/observability/logs/workers-logs/#enable-workers-logs
1010[observability]
1111-enabled = true
1212-1313-# Automatically place your workloads in an optimal location to minimize latency.
1414-# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure
1515-# rather than the end user may result in better performance.
1616-# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
1717-# [placement]
1818-# mode = "smart"
1919-2020-# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables)
2121-# Docs:
2222-# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
2323-# Note: Use secrets to store sensitive data.
2424-# - https://developers.cloudflare.com/workers/configuration/secrets/
2525-# [vars]
2626-# MY_VARIABLE = "production_value"
2727-2828-# Bind the Workers AI model catalog. Run machine learning models, powered by serverless GPUs, on Cloudflare’s global network
2929-# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
3030-# [ai]
3131-# binding = "AI"
3232-3333-# Bind an Analytics Engine dataset. Use Analytics Engine to write analytics within your Pages Function.
3434-# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
3535-# [[analytics_engine_datasets]]
3636-# binding = "MY_DATASET"
3737-3838-# Bind a headless browser instance running on Cloudflare's global network.
3939-# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
4040-# [browser]
4141-# binding = "MY_BROWSER"
4242-4343-# Bind a D1 database. D1 is Cloudflare’s native serverless SQL database.
4444-# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
4545-# [[d1_databases]]
4646-# binding = "MY_DB"
4747-# database_name = "my-database"
4848-# database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
4949-5050-# Bind a dispatch namespace. Use Workers for Platforms to deploy serverless functions programmatically on behalf of your customers.
5151-# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
5252-# [[dispatch_namespaces]]
5353-# binding = "MY_DISPATCHER"
5454-# namespace = "my-namespace"
5555-5656-# Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model.
5757-# Durable Objects can live for as long as needed. Use these when you need a long-running "server", such as in realtime apps.
5858-# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
5959-# [[durable_objects.bindings]]
6060-# name = "MY_DURABLE_OBJECT"
6161-# class_name = "MyDurableObject"
6262-6363-# Durable Object migrations.
6464-# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#migrations
6565-# [[migrations]]
6666-# tag = "v1"
6767-# new_classes = ["MyDurableObject"]
6868-6969-# Bind a Hyperdrive configuration. Use to accelerate access to your existing databases from Cloudflare Workers.
7070-# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
7171-# [[hyperdrive]]
7272-# binding = "MY_HYPERDRIVE"
7373-# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
7474-7575-# Bind a KV Namespace. Use KV as persistent storage for small key-value pairs.
7676-# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
7777-# [[kv_namespaces]]
7878-# binding = "MY_KV_NAMESPACE"
7979-# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
8080-8181-# Bind an mTLS certificate. Use to present a client certificate when communicating with another service.
8282-# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
8383-# [[mtls_certificates]]
8484-# binding = "MY_CERTIFICATE"
8585-# certificate_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
8686-8787-# Bind a Queue producer. Use this binding to schedule an arbitrary task that may be processed later by a Queue consumer.
8888-# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#queues
8989-# [[queues.producers]]
9090-# binding = "MY_QUEUE"
9191-# queue = "my-queue"
9292-9393-# Bind a Queue consumer. Queue Consumers can retrieve tasks scheduled by Producers to act on them.
9494-# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#queues
9595-# [[queues.consumers]]
9696-# queue = "my-queue"
9797-9898-# Bind an R2 Bucket. Use R2 to store arbitrarily large blobs of data, such as files.
9999-# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
100100-# [[r2_buckets]]
101101-# binding = "MY_BUCKET"
102102-# bucket_name = "my-bucket"
103103-104104-# Bind another Worker service. Use this binding to call another Worker without network overhead.
105105-# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
106106-# [[services]]
107107-# binding = "MY_SERVICE"
108108-# service = "my-service"
109109-110110-# Bind a Vectorize index. Use to store and query vector embeddings for semantic search, classification and other vector search use-cases.
111111-# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
112112-# [[vectorize]]
113113-# binding = "MY_INDEX"
114114-# index_name = "my-index"
1111+enabled = true