{"id":47963008,"url":"https://github.com/forgesworn/toll-booth-announce","last_synced_at":"2026-04-12T22:30:24.570Z","repository":{"id":344586977,"uuid":"1182343347","full_name":"forgesworn/toll-booth-announce","owner":"forgesworn","description":"Bridge between toll-booth and 402-announce — announce your toll-booth service on Nostr for decentralised paid API discovery","archived":false,"fork":false,"pushed_at":"2026-03-18T17:55:10.000Z","size":567,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-19T02:33:06.197Z","etag":null,"topics":["402","api-monetisation","bitcoin","decentralised","kind-31402","l402","lightning","nostr","paid-api","service-discovery","toll-booth"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/toll-booth-announce","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/forgesworn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-15T11:46:54.000Z","updated_at":"2026-03-18T18:19:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/forgesworn/toll-booth-announce","commit_stats":null,"previous_names":["thecryptodonkey/toll-booth-announce","forgesworn/toll-booth-announce"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/forgesworn/toll-booth-announce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forgesworn%2Ftoll-booth-announce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forgesworn%2Ftoll-booth-announce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forgesworn%2Ftoll-booth-announce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forgesworn%2Ftoll-booth-announce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forgesworn","download_url":"https://codeload.github.com/forgesworn/toll-booth-announce/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forgesworn%2Ftoll-booth-announce/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31395450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T09:13:02.600Z","status":"ssl_error","status_checked_at":"2026-04-04T09:13:01.683Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["402","api-monetisation","bitcoin","decentralised","kind-31402","l402","lightning","nostr","paid-api","service-discovery","toll-booth"],"created_at":"2026-04-04T10:03:48.928Z","updated_at":"2026-04-04T10:03:49.528Z","avatar_url":"https://github.com/forgesworn.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# toll-booth-announce\n\n**Nostr:** [`npub1mgvlrnf5hm9yf0n5mf9nqmvarhvxkc6remu5ec3vf8r0txqkuk7su0e7q2`](https://njump.me/npub1mgvlrnf5hm9yf0n5mf9nqmvarhvxkc6remu5ec3vf8r0txqkuk7su0e7q2)\n\nAnnounce your [toll-booth](https://github.com/forgesworn/toll-booth) service on Nostr for decentralised paid API discovery.\n\nPublishes a [kind 31402](https://github.com/forgesworn/402-announce) event so AI agents and clients can find your API without a centralised registry.\n\n## Install\n\n```bash\nnpm install toll-booth-announce 402-announce\n```\n\n## Usage\n\n```typescript\nimport { Booth } from '@forgesworn/toll-booth'\nimport { phoenixdBackend } from '@forgesworn/toll-booth/backends/phoenixd'\nimport { announce } from 'toll-booth-announce'\n\n// Your existing toll-booth config\nconst config = {\n  serviceName: 'sats-for-laughs',\n  pricing: {\n    '/api/joke': { default: 5, standard: 21, premium: 42 },\n  },\n  upstream: 'http://localhost:4444',\n  backend: phoenixdBackend({ /* ... */ }),\n  freeTier: { requestsPerDay: 3 },\n}\n\nconst booth = new Booth(config)\n\n// Announce on Nostr — pricing and name derived from config\nconst announcement = await announce(config, {\n  secretKey: process.env.NOSTR_SK,\n  relays: ['wss://relay.damus.io', 'wss://relay.primal.net'],\n  urls: ['https://jokes.trotters.dev'],\n  about: 'Lightning-paid joke API — cracker, standard, and premium jokes',\n  paymentMethods: [['l402', 'lightning']],\n  topics: ['jokes', 'humour', 'bitcoin', 'lightning'],\n})\n\nconsole.log(`Announced as ${announcement.pubkey} (event ${announcement.eventId})`)\n\n// On shutdown\nannouncement.close()\n```\n\n**Multi-transport example** (clearnet + Tor — same service, different access paths):\n\n```typescript\nconst announcement = await announce(config, {\n  secretKey: process.env.NOSTR_SK,\n  relays: ['wss://relay.damus.io', 'wss://relay.primal.net'],\n  urls: [\n    'https://jokes.trotters.dev',          // clearnet\n    'http://jokesxyz...onion',             // Tor hidden service\n  ],\n  about: 'Lightning-paid joke API — cracker, standard, and premium jokes',\n  paymentMethods: [['l402', 'lightning']],\n  topics: ['jokes', 'humour', 'bitcoin', 'lightning'],\n})\n```\n\n`urls` accepts 1–10 entries. Clients try them in order and use whichever they can reach.\n\n## Multiple URLs vs multiple events\n\n**Multiple URLs in one event** — use `urls: ['...', '...']` when the URLs are the **same service** on different transports (clearnet, Tor, Handshake). Pricing, macaroon key, and credits are shared. This provides censorship resistance and redundancy.\n\n**Separate kind 31402 events** — publish a new announcement with a different `identifier` when you have **genuinely different services**: separate pricing, separate capabilities, or services that operate independently.\n\nIn short: same service + different network paths → one event with multiple URLs. Different services → separate events.\n\n## What gets announced\n\nThe bridge reads your toll-booth config and publishes a Nostr event with:\n\n| Field | Source |\n|-------|--------|\n| Service name | `config.serviceName` (defaults to `\"toll-booth\"`) |\n| Pricing | `config.pricing` table — flat or tiered (uses default/lowest tier) |\n| Identifier | Slugified service name (overridable) |\n\nYou provide the fields toll-booth can't know: your public URL, description, Nostr key, relays, and payment methods.\n\n## Part of the 402-announce ecosystem\n\nThis is one of several bridges that publish kind 31402 events for paid API discovery:\n\n- **toll-booth-announce** — for toll-booth services (TypeScript)\n- **aperture-announce** — for Lightning Labs Aperture proxies (Go)\n\nAny client querying Nostr for kind 31402 events can discover your service. See [402-mcp](https://github.com/forgesworn/402-mcp) for an AI agent that does this automatically.\n\n## Licence\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforgesworn%2Ftoll-booth-announce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforgesworn%2Ftoll-booth-announce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforgesworn%2Ftoll-booth-announce/lists"}