{"id":30754168,"url":"https://github.com/ndimensional/atproto-oauth-client-cloudflare-workers","last_synced_at":"2025-09-04T09:08:02.705Z","repository":{"id":310747472,"uuid":"1040444525","full_name":"nDimensional/atproto-oauth-client-cloudflare-workers","owner":"nDimensional","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-20T00:06:26.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-20T02:24:46.844Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nDimensional.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-19T01:53:19.000Z","updated_at":"2025-08-20T00:06:29.000Z","dependencies_parsed_at":"2025-08-20T02:25:58.574Z","dependency_job_id":"97466fa8-5392-4b3d-9576-58baf3e0c98b","html_url":"https://github.com/nDimensional/atproto-oauth-client-cloudflare-workers","commit_stats":null,"previous_names":["ndimensional/atproto-oauth-client-cloudflare-workers"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nDimensional/atproto-oauth-client-cloudflare-workers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nDimensional%2Fatproto-oauth-client-cloudflare-workers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nDimensional%2Fatproto-oauth-client-cloudflare-workers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nDimensional%2Fatproto-oauth-client-cloudflare-workers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nDimensional%2Fatproto-oauth-client-cloudflare-workers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nDimensional","download_url":"https://codeload.github.com/nDimensional/atproto-oauth-client-cloudflare-workers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nDimensional%2Fatproto-oauth-client-cloudflare-workers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273581223,"owners_count":25131393,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-04T09:06:39.402Z","updated_at":"2025-09-04T09:08:02.693Z","avatar_url":"https://github.com/nDimensional.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# atproto-oauth-client-cloudflare-workers\n\nThis library contains local patched copies of\n\n- [`@atproto/oauth-client-node`](https://github.com/bluesky-social/atproto/tree/main/packages/oauth/oauth-client-node)\n- [`@atproto/oauth-client`](https://github.com/bluesky-social/atproto/tree/main/packages/oauth/oauth-client)\n- [`@atproto-labs/handle-resolver-node`](https://github.com/bluesky-social/atproto/tree/main/packages/internal/handle-resolver-node)\n- [`@atproto-labs/handle-resolver`](https://github.com/bluesky-social/atproto/tree/main/packages/internal/handle-resolver)\n- [`@atproto-labs/identity-resolver`](https://github.com/bluesky-social/atproto/tree/main/packages/internal/identity-resolver)\n- [`@atproto-labs/did-resolver`](https://github.com/bluesky-social/atproto/tree/main/packages/internal/did-resolver)\n\nthat are compatible with the Cloudflare Workers edge runtime.\n\nThe only changes applied throughout are:\n\n1. replacing `request.cache: \"no-cache\"` with `request.headers[\"cache-control\"]: \"no-cache\"`\n2. replacing `request.redirect: \"error\"` with `request.redirect: \"follow\"`\n\nDNS handle resolution requires the [`nodejs_compat` compatibility flag](https://developers.cloudflare.com/workers/runtime-apis/nodejs/).\n\n## Usage\n\n`WorkersOAuthClient` works mostly as a drop-in replacement for `NodeOAuthClient`.\n\n```ts\nimport { WorkersOAuthClient } from \"atproto-oauth-client-cloudflare-workers\"\n\nexport const client = new WorkersOAuthClient({\n\tclientMetadata: {\n\t  // ...\n\t}\n}\n```\n\nBy default, like `NodeOAuthClient`, this will use an in-memory store for the handle cache and DID cache. This doesn't make much sense for the workers environment, since memory is reset after each invocation. To use Cloudflare KV namespaces for your handle and DID caches, create `DidCacheKV` and `HandleCacheKV` instances and pass them to the `WorkersOAuthClient` constructor.\n\nSimilarly, to use KV namespaces for the oauth state store and oauth session store, (which are required), import and provide `StateStoreKV` and `SessionStoreKV` instances.\n\n```ts\nimport { env } from \"cloudflare:workers\"\n\nimport {\n\tWorkersOAuthClient,\n\tDidCacheKV,\n\tHandleCacheKV,\n\tStateStoreKV,\n\tSessionStoreKV,\n} from \"atproto-oauth-client-cloudflare-workers\";\n\nexport const client = new WorkersOAuthClient({\n  // did -\u003e didDocument cache\n\tdidCache: new DidCacheKV(env.DID_CACHE),\n\t// handle -\u003e did cache\n\thandleCache: new HandleCacheKV(env.HANDLE_CACHE),\n\n\tclientMetadata: {\n\t  // Interface to store authorization state data (during authorization flows)\n\t\tstateStore: new StateStoreKV(env.OAUTH_STATE_STORE),\n\t\t// Interface to store authenticated session data\n\t  sessionStore: new SessionStoreKV(env.OAUTH_SESSION_STORE),\n\n\t\t// ...\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fndimensional%2Fatproto-oauth-client-cloudflare-workers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fndimensional%2Fatproto-oauth-client-cloudflare-workers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fndimensional%2Fatproto-oauth-client-cloudflare-workers/lists"}