{"id":13832771,"url":"https://github.com/getAlby/http-nostr-publisher","last_synced_at":"2025-07-09T19:31:18.499Z","repository":{"id":78499460,"uuid":"604571274","full_name":"getAlby/http-nostr-publisher","owner":"getAlby","description":"A Cloudflare worker to publish Nostr events to relays through a non-blocking HTTP interface","archived":false,"fork":false,"pushed_at":"2023-05-16T08:13:10.000Z","size":62,"stargazers_count":14,"open_issues_count":3,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-02-17T05:34:17.058Z","etag":null,"topics":["cloudflare","cloudflare-workers","http","nostr","nostr-protocol"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getAlby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-02-21T10:45:20.000Z","updated_at":"2023-07-20T03:33:10.000Z","dependencies_parsed_at":"2024-01-13T16:30:42.297Z","dependency_job_id":"792c525b-061d-40fc-bb92-e3ceffa3211f","html_url":"https://github.com/getAlby/http-nostr-publisher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getAlby%2Fhttp-nostr-publisher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getAlby%2Fhttp-nostr-publisher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getAlby%2Fhttp-nostr-publisher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getAlby%2Fhttp-nostr-publisher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getAlby","download_url":"https://codeload.github.com/getAlby/http-nostr-publisher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225581836,"owners_count":17491794,"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","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":["cloudflare","cloudflare-workers","http","nostr","nostr-protocol"],"created_at":"2024-08-04T11:00:30.327Z","updated_at":"2024-11-20T15:31:05.084Z","avatar_url":"https://github.com/getAlby.png","language":"JavaScript","funding_links":[],"categories":["Install from Source","Tools"],"sub_categories":["Nostr","Client reviews and/or comparisons"],"readme":"# HTTP to Nostr Cloudflare worker\n\nThis [Cloudflare worker](https://workers.cloudflare.com/) exposes a HTTP interface to publish events to specified Nostr relays. \nThe HTTP request is non-blocking and will immediatelly return. The events will be published asynchronously.\n\nThe goal of this worker is to make it easier to integrate publishing events into any application. \nUsing this worker applications do not need to integrate websockets and can publish events through a non-blocking HTTP request.\n\n\n## API\n\n### POST /publish\n\nSend a JSON body with the the event and the relays that the event should be published to.\n\n```json\n{\n  \"relays\": [\"relay.damus.io\", \"relay.snort.social\"],\n  \"event\": { JSON of the EVENT }\n}\n\n```\n\nThe HTTP request will immediatelly return and the the events are published asynchonously. \n\n### POST /profile\n\nRetrieve the profile for a pubkey.\n\n```json\n{\n  \"relays\": [\"relay.damus.io\", \"relay.snort.social\"],\n  \"pubkey\": \"profile-pubkey\"\n}\n\n```\n\nIf a profile is already cached it will return with `HTTP status 200`. \n\nIf a profile is NOT already cached it will return with `HTTP status 202` and query the profile asynchronously.\n\n\n\n## Configuration\n\n#### Cloudflare KV\n\nThe profile data is cached in a [worker KV](https://developers.cloudflare.com/workers/runtime-apis/kv/) (a global, low-latency, key-value data store). \n\nConfigure the KV:\n\n```\n$ wrangler kv:namespace create PROFILES\n$ wrangler kv:namespace create PROFILES --preview\n```\n\nand add the `kv_namespaces` array to the wrangler.toml\n\n#### API Token\n\nTo protect your worker you can set a `API_TOKEN` environment variable.\n\nClients then need to send this token in a `API-TOKEN` HTTP header.\n\n\n## Deployment\n\nRefer to the [Cloudflare docs](https://developers.cloudflare.com/workers/get-started/guide/) Learn more about Cloudflare workers and how to publish workers\n\n```\n$ wrangler publish\n```\n\n## Development\n\n```\n$ wrangler dev\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FgetAlby%2Fhttp-nostr-publisher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FgetAlby%2Fhttp-nostr-publisher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FgetAlby%2Fhttp-nostr-publisher/lists"}