{"id":21984082,"url":"https://github.com/jinglescode/nostr-chat-plugin","last_synced_at":"2026-02-04T06:03:24.546Z","repository":{"id":258127899,"uuid":"872516136","full_name":"jinglescode/nostr-chat-plugin","owner":"jinglescode","description":"A chat room React component that uses NOSTR protocol for messaging.","archived":false,"fork":false,"pushed_at":"2024-10-16T07:10:56.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-20T01:57:06.467Z","etag":null,"topics":["nostr"],"latest_commit_sha":null,"homepage":"https://jingles.dev/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jinglescode.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":"2024-10-14T15:12:40.000Z","updated_at":"2025-09-01T06:53:23.000Z","dependencies_parsed_at":"2024-10-18T06:06:01.569Z","dependency_job_id":null,"html_url":"https://github.com/jinglescode/nostr-chat-plugin","commit_stats":null,"previous_names":["jinglescode/nostr-chat-plugin"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jinglescode/nostr-chat-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinglescode%2Fnostr-chat-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinglescode%2Fnostr-chat-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinglescode%2Fnostr-chat-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinglescode%2Fnostr-chat-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jinglescode","download_url":"https://codeload.github.com/jinglescode/nostr-chat-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinglescode%2Fnostr-chat-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29072473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T03:31:03.593Z","status":"ssl_error","status_checked_at":"2026-02-04T03:29:50.742Z","response_time":62,"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":["nostr"],"created_at":"2024-11-29T18:07:23.709Z","updated_at":"2026-02-04T06:03:24.528Z","avatar_url":"https://github.com/jinglescode.png","language":"TypeScript","readme":"# Nostr Chat Provider\n\nA chat room React component that uses NOSTR protocol for messaging.\n\n### Usage\n\nInstall the package using npm:\n\n```bash\nnpm install @jinglescode/nostr-chat-plugin\n```\n\nIn your `_app.tsx` file, import `NostrChatProvider` and wrap your component with it:\n\n```typescript\nimport { NostrChatProvider } from \"@jinglescode/nostr-chat-plugin\";\n\nexport default function App({ Component, pageProps }: AppProps) {\n  return (\n    \u003cNostrChatProvider\u003e\n      \u003cComponent {...pageProps} /\u003e\n    \u003c/NostrChatProvider\u003e\n  );\n}\n```\n\nTo use the chat component, import `useNostrChat`:\n\n```typescript\nimport { useNostrChat } from \"@jinglescode/nostr-chat-plugin\";\n\nconst { subscribeRoom, publishMessage, messages, generateNsec, setUser } =\n  useNostrChat();\n```\n\n### API\n\nFirst, depending if your user has a nostr key, if not, you can generate one:\n\n```typescript\nconst {\n  nsec: string;\n  pubkey: string;\n} = generateNsec();\n```\n\nFor users that already have a nostr key, you can set it:\n\n```typescript\nsetUser({\n  nsec: nsec,\n  pubkey: pubkey,\n});\n```\n\nThen, when user enters a page with chat, you can subscribe to a room ID:\n\n```typescript\nsubscribeRoom(\"room-id-here\");\n```\n\nDoing so will populate and listen for new `messages` from the room.\n\nWhen the connected user wants to send a message, they can publish a message to the room:\n\n```typescript\npublishMessage(\"message here\");\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjinglescode%2Fnostr-chat-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjinglescode%2Fnostr-chat-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjinglescode%2Fnostr-chat-plugin/lists"}