{"id":31573968,"url":"https://github.com/cnixbtc/nostrkit","last_synced_at":"2025-10-05T15:39:08.398Z","repository":{"id":172843309,"uuid":"528878244","full_name":"cnixbtc/NostrKit","owner":"cnixbtc","description":"A simple Swift library providing data types for interacting with Nostr relays.","archived":false,"fork":false,"pushed_at":"2024-01-25T13:49:45.000Z","size":25,"stargazers_count":18,"open_issues_count":3,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-10T02:25:19.987Z","etag":null,"topics":["ios","macos","nostr","swift"],"latest_commit_sha":null,"homepage":"https://github.com/cnixbtc/NostrKit","language":"Swift","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/cnixbtc.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}},"created_at":"2022-08-25T14:05:40.000Z","updated_at":"2025-02-04T07:09:30.000Z","dependencies_parsed_at":"2024-05-29T23:55:24.760Z","dependency_job_id":"57d1f911-02ee-4970-be0b-75b36b69bf0b","html_url":"https://github.com/cnixbtc/NostrKit","commit_stats":null,"previous_names":["cnixbtc/nostrkit"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/cnixbtc/NostrKit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnixbtc%2FNostrKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnixbtc%2FNostrKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnixbtc%2FNostrKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnixbtc%2FNostrKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cnixbtc","download_url":"https://codeload.github.com/cnixbtc/NostrKit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnixbtc%2FNostrKit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278477823,"owners_count":25993540,"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-10-05T02:00:06.059Z","response_time":54,"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":["ios","macos","nostr","swift"],"created_at":"2025-10-05T15:39:07.560Z","updated_at":"2025-10-05T15:39:08.392Z","avatar_url":"https://github.com/cnixbtc.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🗒 NostrKit \n\nA Swift library providing data types for interacting with a [Nostr](https://github.com/nostr-protocol/nostr) relay.\n\n## Installation\n\nNostrKit is available as a [Swift Package Manager](https://swift.org/package-manager/) package.\nTo use it, add the following dependency to your `Package.swift` file:\n\n``` swift\n.package(url: \"https://github.com/cnixbtc/NostrKit.git\", from: \"1.0.0\"),\n```\n\n## Functionality\n\nNostrKit provides the necessary data types for interacting with a Nostr relay to create events and manage subscriptions.\n\n### Subscribing to Events\n\n``` swift\nlet keyPair = try KeyPair(privateKey: \"\u003chex\u003e\")\n\nlet subscription = Subscription(filters: [\n    .init(authors: [keyPair.publicKey])\n])\n\nlet subscribeMessage = try ClientMessage\n    .subscribe(subscription)\n    .string()\n\n// Subscribe to events created by this key pair by sending `subscribeMessage` \n// to a relay using a web socket connection of your choice. \n// Later on, create a message to unsubscribe like so:\n\nlet unsubscribeMessage = try ClientMessage\n    .unsubscribe(subscription.id)\n    .string()\n```\n\n### Publishing Events\n\n``` swift\nlet keyPair = try KeyPair(privateKey: \"\u003chex\u003e\")\n\nlet event = try Event(keyPair: keyPair, content: \"Hello NostrKit.\")\n\nlet message = ClientMessage\n    .event(event)\n    .string()\n\n// Publish the event by sending `subscribeMessage` \n// to a relay using a web socket connection of your choice. \n```\n\nFully functional code examples can be found in `Sources/ExampleReader` as well as `Sources/ExampleWriter`.\nRun `swift run example-reader` and `swift run example-writer` to see them in action.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcnixbtc%2Fnostrkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcnixbtc%2Fnostrkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcnixbtc%2Fnostrkit/lists"}