{"_id":"@belomonte/ngx-parody-api","_rev":"7-85d1a1689eabb80e048f57e677b83dd3","name":"@belomonte/ngx-parody-api","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"@belomonte/ngx-parody-api","version":"0.1.0","author":{"name":"António Conselheiro"},"license":"Ungovernable","_id":"@belomonte/ngx-parody-api@0.1.0","maintainers":[{"name":"anarcanudos","email":"canudos.sudestino@gmail.com"}],"dist":{"shasum":"4cce69f7969bde85f9d0d4b812ff27b2403b2a47","tarball":"https://registry.npmjs.org/@belomonte/ngx-parody-api/-/ngx-parody-api-0.1.0.tgz","fileCount":52,"integrity":"sha512-WecbmgnQVjqVnLa1n0Hbvwm2SXKzld/sHn7O5cTpV6KS4bnBrtInCJ1z63GuokiYOASWYJ0GgTlNm/Cw55sUHA==","signatures":[{"sig":"MEUCIQCbaYme8kkDeND2UAs29/Pccm4lF6TnW6t5twiTpLkKSwIgB3kXWMrm3gR/XaqF9wsfoSMYtrNF31ZeKdldiBP5t/8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":253989},"module":"fesm2022/belomonte-ngx-parody-api.mjs","exports":{".":{"esm":"./esm2022/belomonte-ngx-parody-api.mjs","types":"./index.d.ts","default":"./fesm2022/belomonte-ngx-parody-api.mjs","esm2022":"./esm2022/belomonte-ngx-parody-api.mjs"},"./package.json":{"default":"./package.json"}},"gitHead":"53e9799dc4324b90fda525179d78a9d9efa49d3c","typings":"index.d.ts","_npmUser":{"name":"anarcanudos","email":"canudos.sudestino@gmail.com"},"_npmVersion":"10.8.2","description":"> Matthew 5 > > [43] Ye have heard that it hath been said, Thou shalt love thy neighbour, and hate thine enemy. [44] But I say unto you, Love your enemies, bless them that curse you, do good to them that hate you, and pray for them which despitefully use ","directories":{},"sideEffects":false,"_nodeVersion":"20.18.0","dependencies":{"tslib":"^2.3.0"},"_hasShrinkwrap":false,"peerDependencies":{"nostr-tools":"^2.10.3","@angular/core":"^18.2.0","@angular/common":"^18.2.0","@nostrify/nostrify":"npm:@jsr/nostrify__nostrify@^0.36.1"},"_npmOperationalInternal":{"tmp":"tmp/ngx-parody-api_0.1.0_1732212284618_0.7398049742569417","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@belomonte/ngx-parody-api","version":"0.1.1","author":{"name":"António Conselheiro"},"license":"Ungovernable","_id":"@belomonte/ngx-parody-api@0.1.1","maintainers":[{"name":"anarcanudos","email":"canudos.sudestino@gmail.com"}],"dist":{"shasum":"921fb4bc5565297fcd07f6005fb8c8182dc13f9d","tarball":"https://registry.npmjs.org/@belomonte/ngx-parody-api/-/ngx-parody-api-0.1.1.tgz","fileCount":52,"integrity":"sha512-nllt6GUbm08Qk7t+2eBTjlH8RJ1/QPJxuRlMSa6/f4e0uAI6pt4w/pTb7VmgJFxWFxi5Lg4Likxrniii9HS5Kg==","signatures":[{"sig":"MEUCIQDCn5GqkJ9s2GYbVKsaxkHxCuzaUbAI6vGdehnZMKhJHwIgFMKwkgNPjNOrpIfU71axvpYFeqCSdkFh2zTqKu5IqRM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":254016},"module":"fesm2022/belomonte-ngx-parody-api.mjs","exports":{".":{"esm":"./esm2022/belomonte-ngx-parody-api.mjs","types":"./index.d.ts","default":"./fesm2022/belomonte-ngx-parody-api.mjs","esm2022":"./esm2022/belomonte-ngx-parody-api.mjs"},"./package.json":{"default":"./package.json"}},"gitHead":"53e9799dc4324b90fda525179d78a9d9efa49d3c","typings":"index.d.ts","_npmUser":{"name":"anarcanudos","email":"canudos.sudestino@gmail.com"},"_npmVersion":"10.8.2","description":"> Matthew 5 > > [43] Ye have heard that it hath been said, Thou shalt love thy neighbour, and hate thine enemy. [44] But I say unto you, Love your enemies, bless them that curse you, do good to them that hate you, and pray for them which despitefully use ","directories":{},"sideEffects":false,"_nodeVersion":"20.18.0","dependencies":{"tslib":"^2.3.0"},"_hasShrinkwrap":false,"peerDependencies":{"nostr-tools":"^2.10.3","@angular/core":"^18.2.0","@angular/common":"^18.2.0","@nostrify/nostrify":"npm:@jsr/nostrify__nostrify@^0.36.1"},"_npmOperationalInternal":{"tmp":"tmp/ngx-parody-api_0.1.1_1732212489424_0.8923704887752983","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"@belomonte/ngx-parody-api","version":"0.1.2","author":{"name":"António Conselheiro"},"license":"Ungovernable","_id":"@belomonte/ngx-parody-api@0.1.2","maintainers":[{"name":"anarcanudos","email":"canudos.sudestino@gmail.com"}],"dist":{"shasum":"9944e4f470d35211409dd8d77f88f4727a4acaaa","tarball":"https://registry.npmjs.org/@belomonte/ngx-parody-api/-/ngx-parody-api-0.1.2.tgz","fileCount":52,"integrity":"sha512-mrMHiO0MVWK2/vz2oG5zClCI3HeS+zMITLgzttQW4NwlhrMLloKx6iZXOg1rILdtysEUIla3WRmWaBwayucayQ==","signatures":[{"sig":"MEYCIQD5Pk5GLR8CiwuCuvoPS7DtrKIyzhLi/mQLHcxuepCTaAIhAJ0XSlYa+LXyWJo3pgwArZ3RaILDVnbF5kmGFM8DGiWc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":258375},"module":"fesm2022/belomonte-ngx-parody-api.mjs","exports":{".":{"esm":"./esm2022/belomonte-ngx-parody-api.mjs","types":"./index.d.ts","default":"./fesm2022/belomonte-ngx-parody-api.mjs","esm2022":"./esm2022/belomonte-ngx-parody-api.mjs"},"./package.json":{"default":"./package.json"}},"gitHead":"fc7b3190361fb57bc4b8a943f86c04bc51c7d468","typings":"index.d.ts","_npmUser":{"name":"anarcanudos","email":"canudos.sudestino@gmail.com"},"_npmVersion":"10.8.2","description":"> Matthew 5 > > [43] Ye have heard that it hath been said, Thou shalt love thy neighbour, and hate thine enemy. [44] But I say unto you, Love your enemies, bless them that curse you, do good to them that hate you, and pray for them which despitefully use ","directories":{},"sideEffects":false,"_nodeVersion":"20.18.0","dependencies":{"tslib":"^2.3.0"},"_hasShrinkwrap":false,"peerDependencies":{"nostr-tools":"^2.10.4","@angular/core":"^18.2.0","@angular/common":"^18.2.0","@nostrify/nostrify":"npm:@jsr/nostrify__nostrify@^0.36.1"},"_npmOperationalInternal":{"tmp":"tmp/ngx-parody-api_0.1.2_1733917276231_0.7760982675980661","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@belomonte/ngx-parody-api","version":"0.1.3","keywords":["angular","typescript","nostr"],"author":{"name":"António Conselheiro"},"license":"Ungovernable","_id":"@belomonte/ngx-parody-api@0.1.3","maintainers":[{"name":"anarcanudos","email":"canudos.sudestino@gmail.com"}],"homepage":"https://github.com/antonioconselheiro/ngx-parody-api#readme","bugs":{"url":"https://github.com/antonioconselheiro/ngx-parody-api/issues"},"dist":{"shasum":"65863a0b81422b60ebf252736aaedfe95694d9ac","tarball":"https://registry.npmjs.org/@belomonte/ngx-parody-api/-/ngx-parody-api-0.1.3.tgz","fileCount":52,"integrity":"sha512-WzDB3OCg+9x6q9B7BPxj4fGUccfpD78edWdd6mY16a/1nEaIMWW0iMKC3Zn3Fnyf2+Te2BgAAdixlSM0hKLFow==","signatures":[{"sig":"MEUCIQCu/686XTkONT+od7eCNOMff8L74XFnMISWB6xYzPxKMwIgR2x00JlfpvmrUnFPDcG559/GYgwbDh1iSRA2JQsXhp0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":260364},"module":"fesm2022/belomonte-ngx-parody-api.mjs","exports":{".":{"esm":"./esm2022/belomonte-ngx-parody-api.mjs","types":"./index.d.ts","default":"./fesm2022/belomonte-ngx-parody-api.mjs","esm2022":"./esm2022/belomonte-ngx-parody-api.mjs"},"./package.json":{"default":"./package.json"}},"gitHead":"1a83eb288b558ee23b65802d4f39ed5bc992a072","typings":"index.d.ts","_npmUser":{"name":"anarcanudos","email":"canudos.sudestino@gmail.com"},"repository":{"url":"git+https://github.com/antonioconselheiro/ngx-parody-api.git","type":"git"},"_npmVersion":"10.8.2","description":"> Matthew 5 > > [43] Ye have heard that it hath been said, Thou shalt love thy neighbour, and hate thine enemy. [44] But I say unto you, Love your enemies, bless them that curse you, do good to them that hate you, and pray for them which despitefully use ","directories":{},"sideEffects":false,"_nodeVersion":"20.19.1","dependencies":{"tslib":"^2.3.0"},"_hasShrinkwrap":false,"peerDependencies":{"nostr-tools":"^2.10.4","@angular/core":"^18.2.0","@angular/common":"^18.2.0","@nostrify/nostrify":"npm:@jsr/nostrify__nostrify@^0.36.1"},"_npmOperationalInternal":{"tmp":"tmp/ngx-parody-api_0.1.3_1745601157013_0.9854356993720712","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@belomonte/ngx-parody-api","version":"0.2.0","keywords":["angular","typescript","nostr"],"author":{"name":"António Conselheiro"},"license":"Ungovernable","_id":"@belomonte/ngx-parody-api@0.2.0","maintainers":[{"name":"anarcanudos","email":"canudos.sudestino@gmail.com"}],"homepage":"https://github.com/antonioconselheiro/ngx-parody-api#readme","bugs":{"url":"https://github.com/antonioconselheiro/ngx-parody-api/issues"},"dist":{"shasum":"2fba2764741a333a9030925f8039ea495f1bdbd9","tarball":"https://registry.npmjs.org/@belomonte/ngx-parody-api/-/ngx-parody-api-0.2.0.tgz","fileCount":61,"integrity":"sha512-YOq6zikxrCqEU6at2KHJfnwgvM1eokideWyN1vT7gVUzmQVZbWLDAsU8wPCy+xV2DNlcYnXSA04BzCzVRjN6Ww==","signatures":[{"sig":"MEUCIAXI+n2pfVIk7RWrDUgbNigKQR3J6fxZ2o9GUde0FtAZAiEA8jw2renRZJpX8imIdOqUgKgLESxiDJ3xg/STGoNBt4U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":249890},"module":"fesm2022/belomonte-ngx-parody-api.mjs","exports":{".":{"esm":"./esm2022/belomonte-ngx-parody-api.mjs","types":"./index.d.ts","default":"./fesm2022/belomonte-ngx-parody-api.mjs","esm2022":"./esm2022/belomonte-ngx-parody-api.mjs"},"./package.json":{"default":"./package.json"}},"gitHead":"341bff41063eb513c930f38792ad8a92b8e7caaa","typings":"index.d.ts","_npmUser":{"name":"anarcanudos","email":"canudos.sudestino@gmail.com"},"repository":{"url":"git+https://github.com/antonioconselheiro/ngx-parody-api.git","type":"git"},"_npmVersion":"10.8.2","description":"> Matthew 5 > > [43] Ye have heard that it hath been said, Thou shalt love thy neighbour, and hate thine enemy. [44] But I say unto you, Love your enemies, bless them that curse you, do good to them that hate you, and pray for them which despitefully use ","directories":{},"sideEffects":false,"_nodeVersion":"20.19.1","dependencies":{"tslib":"^2.3.0"},"_hasShrinkwrap":false,"peerDependencies":{"nostr-tools":"^2.10.4","@angular/core":"^18.2.0","@angular/common":"^18.2.0","@nostrify/nostrify":"npm:@jsr/nostrify__nostrify@^0.36.1"},"_npmOperationalInternal":{"tmp":"tmp/ngx-parody-api_0.2.0_1749416251345_0.8872814283114516","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@belomonte/ngx-parody-api","version":"0.2.1","keywords":["angular","typescript","nostr"],"author":{"name":"António Conselheiro"},"license":"Ungovernable","_id":"@belomonte/ngx-parody-api@0.2.1","maintainers":[{"name":"anarcanudos","email":"canudos.sudestino@gmail.com"}],"homepage":"https://github.com/antonioconselheiro/ngx-parody-api#readme","bugs":{"url":"https://github.com/antonioconselheiro/ngx-parody-api/issues"},"dist":{"shasum":"6bdc2a715756c4fa51d050e59ffd21161c8204c3","tarball":"https://registry.npmjs.org/@belomonte/ngx-parody-api/-/ngx-parody-api-0.2.1.tgz","fileCount":61,"integrity":"sha512-7MoHUDMz3jkBvEfP8Xzno+ylJxHREXfUB4dMoLZk5AT7f0NlZWZC2qbx7Q/EgMAjEnl5838am2c49fGxTvWU0Q==","signatures":[{"sig":"MEYCIQDhkTjim3voNMm21IieZAO2wZi8eJq40WoW6KEmIWmQEgIhAOJwAbzpCnrDwCJJlPcOWYxiMImDaO4iy38t1aIVkKKf","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":250574},"module":"fesm2022/belomonte-ngx-parody-api.mjs","exports":{".":{"esm":"./esm2022/belomonte-ngx-parody-api.mjs","types":"./index.d.ts","default":"./fesm2022/belomonte-ngx-parody-api.mjs","esm2022":"./esm2022/belomonte-ngx-parody-api.mjs"},"./package.json":{"default":"./package.json"}},"gitHead":"2b0cb115818a6b5797f3fdf4f7bdb501a73924c4","typings":"index.d.ts","_npmUser":{"name":"anarcanudos","email":"canudos.sudestino@gmail.com"},"repository":{"url":"git+https://github.com/antonioconselheiro/ngx-parody-api.git","type":"git"},"_npmVersion":"10.8.2","description":"> Matthew 5 > > [43] Ye have heard that it hath been said, Thou shalt love thy neighbour, and hate thine enemy. [44] But I say unto you, Love your enemies, bless them that curse you, do good to them that hate you, and pray for them which despitefully use ","directories":{},"sideEffects":false,"_nodeVersion":"20.19.1","dependencies":{"tslib":"^2.3.0"},"_hasShrinkwrap":false,"peerDependencies":{"nostr-tools":"^2.10.4","@angular/core":"^18.2.0","@angular/common":"^18.2.0","@nostrify/nostrify":"npm:@jsr/nostrify__nostrify@^0.36.1"},"_npmOperationalInternal":{"tmp":"tmp/ngx-parody-api_0.2.1_1749416934506_0.9933678628693086","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@belomonte/ngx-parody-api","version":"0.2.2","author":{"name":"António Conselheiro"},"license":"Ungovernable","keywords":["angular","typescript","nostr"],"repository":{"type":"git","url":"git+https://github.com/antonioconselheiro/ngx-parody-api.git"},"peerDependencies":{"@angular/common":"^18.2.0","@angular/core":"^18.2.0","@nostrify/nostrify":"npm:@jsr/nostrify__nostrify@^0.36.1","nostr-tools":"^2.10.4"},"dependencies":{"tslib":"^2.3.0"},"sideEffects":false,"module":"fesm2022/belomonte-ngx-parody-api.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2022":"./esm2022/belomonte-ngx-parody-api.mjs","esm":"./esm2022/belomonte-ngx-parody-api.mjs","default":"./fesm2022/belomonte-ngx-parody-api.mjs"}},"_id":"@belomonte/ngx-parody-api@0.2.2","gitHead":"fd7520af5d5b85c3d8cdacea13951ce3d9ffd246","description":"> Matthew 5 > > [43] Ye have heard that it hath been said, Thou shalt love thy neighbour, and hate thine enemy. [44] But I say unto you, Love your enemies, bless them that curse you, do good to them that hate you, and pray for them which despitefully use ","bugs":{"url":"https://github.com/antonioconselheiro/ngx-parody-api/issues"},"homepage":"https://github.com/antonioconselheiro/ngx-parody-api#readme","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-G4Bame5rT2yNFepIWyY1XcJdrEv84t2uEMEOBZLrxiNWdPPiBNqLL2HVUZQXKmOBw+EfGUYqSa3kTRtFHct4DQ==","shasum":"4dd4bebfd430e51a88ed7f03364a3d53dae93d41","tarball":"https://registry.npmjs.org/@belomonte/ngx-parody-api/-/ngx-parody-api-0.2.2.tgz","fileCount":61,"unpackedSize":253279,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDH16kwEyZMPcSIou+M0UAQNm0b2LaaVvyhE96irIlRaQIgUrXNey/KCOEe6gObbzDR9CKPql0u8lFKmAJemVEBH8Y="}]},"_npmUser":{"name":"anarcanudos","email":"canudos.sudestino@gmail.com"},"directories":{},"maintainers":[{"name":"anarcanudos","email":"canudos.sudestino@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ngx-parody-api_0.2.2_1770290501733_0.7271185375966036"},"_hasShrinkwrap":false}},"time":{"created":"2024-11-21T18:04:44.529Z","modified":"2026-02-05T11:21:41.991Z","0.1.0":"2024-11-21T18:04:44.846Z","0.1.1":"2024-11-21T18:08:09.633Z","0.1.2":"2024-12-11T11:41:16.452Z","0.1.3":"2025-04-25T17:12:37.218Z","0.2.0":"2025-06-08T20:57:31.533Z","0.2.1":"2025-06-08T21:08:54.686Z","0.2.2":"2026-02-05T11:21:41.880Z"},"bugs":{"url":"https://github.com/antonioconselheiro/ngx-parody-api/issues"},"author":{"name":"António Conselheiro"},"license":"Ungovernable","homepage":"https://github.com/antonioconselheiro/ngx-parody-api#readme","keywords":["angular","typescript","nostr"],"repository":{"type":"git","url":"git+https://github.com/antonioconselheiro/ngx-parody-api.git"},"description":"> Matthew 5 > > [43] Ye have heard that it hath been said, Thou shalt love thy neighbour, and hate thine enemy. [44] But I say unto you, Love your enemies, bless them that curse you, do good to them that hate you, and pray for them which despitefully use ","maintainers":[{"name":"anarcanudos","email":"canudos.sudestino@gmail.com"}],"readme":"> Matthew 5\n>\n> [43] Ye have heard that it hath been said, Thou shalt love thy neighbour, and hate thine enemy. [44] But I say unto you, Love your enemies, bless them that curse you, do good to them that hate you, and pray for them which despitefully use you, and persecute you; [45] that ye may be the children of your Father which is in heaven: **for he maketh his sun to rise on the evil and on the good, and sendeth rain on the just and on the unjust.**\n\n# Parody Api\nIf you code using this lib you [automatically become a cypherpunk](https://cdn.nakamotoinstitute.org/docs/cypherpunk-manifesto.txt).\n\n## Features of each parody project\n![Parody family](https://raw.githubusercontent.com/antonioconselheiro/ngx-parody-api/refs/heads/main/docs/imgs/parody-api.png)\n\n## Parody Projects\nParody projects are jokes in the form of fully functional clients nostr.\n\n - [Omeglestr](https://github.com/antonioconselheiro/omeglestr) was the last joke told, you can access [this here](https://antonioconselheiro.github.io/omeglestr/#/chat).\n - [Twitter ᴾᵃʳᵒᵈʸ](https://github.com/antonioconselheiro/twitter-parody) it's a joke in progress.\n\nI'm still going to tell a lot of jokes, all algorithms with nostr that allow these clients to perform their respective social network interactions will be centralized in this library.\n\nMany will say that it is just a work of plagiarism and that there is no joke. If you do not understand humor and do not want to acquire a joke, do not interfere with my business.\n\n## Warning\nIn release `1.x.x` this package will include `@belomonte/nostr-ngx` dependency, but `0.x.x` will be used while `@belomonte/nostr-ngx` is not released.\n`@belomonte/nostr-ngx` will bring angular services to solve pool questions like relay routing, signing, cache for events and profile, deep kinds and interfaces and media uploading.\n\n`@belomonte/nostr-ngx` will bring an extended version of NPool and it will read user configuration from his own storages structures, by using this package you must understand that means bring `@belomonte/nostr-ngx` basis archicture to your project, having `@belomonte/nostr-ngx` your project will be available to use `@belomonte/nostr-gui-ngx`, with some predefined components to allow user customize his configurations and other common screens that can be used in a nostr app.\n\nThe packages `@belomonte/nostr-ngx`, `@belomonte/nostr-gui-ngx` and `@belomonte/ngx-parody-api` are part of the same porpouse: bring to angular the classic social networks feature using nostr. At first, they will be just the reusable things from Twitter Parody, but there are plans to other parody projects and these classic social network features will be centralized in these libraries.\n\n| Library | Release | Porpouse |\n|-------------|-------------|-------------|\n| @belomonte/nostr-ngx | Not released | Services to deal with nostr, it bring overridable taken decisions, allowing you override services to customize core behaviors  |\n| @belomonte/nostr-gui-ngx | Not released | Read-to-use components to allow user set his configs, choose profile and signer, but also publish note, chat |\n| @belomonte/ngx-parody-api | Released | Classic social network features that require algorithms with a higher level of complexity to be established |\n\n## Installing\n`npm install @belomonte/ngx-parody-api --save`\n\n`@nostrify/nostrify` is a dependecy from jsr registry, you may need add this dependecy like this:\n\n`npx jsr add @nostrify/nostrify`\n\n### Updating\n`ng update` in angular cli 18 or lower [launches error](https://github.com/angular/angular-cli/issues/28834) when need update dependencies from registries different from npm either with .npmrc file in the project, so, if you need to update your project you may have to update this package \"manually\" by running this command again.\n\n## How To Use\n### Configure\nThe only available social network feature in this `@belomonte/ngx-parody-api` version is the `Talk to Stranger` feature from [Omeglestr](https://github.com/antonioconselheiro/omeglestr).\n\n<!-- basic example -->\n\nImport TalkToStrangerModule and provide NPool configs:\n\n```typescript\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { OmegleNPoolOpts } from './omegle.npool-opts';\nimport { POOL_OPTIONS_TOKEN, TalkToStrangerModule } from '@belomonte/ngx-parody-api';\n\n@NgModule({\n  imports: [\n    CommonModule,\n    TalkToStrangerModule\n  ],\n  providers: [\n    {\n      provide: POOL_OPTIONS_TOKEN,\n      useClass: OmegleNPoolOpts\n    }\n  ],\n  exports: [\n    TalkToStrangerModule\n  ]\n})\nexport class OmegleModule { }\n```\n\n```typescript\nimport { TypingStatusDirective } from '@belomonte/ngx-parody-api';\n\n@NgModule({\n  declarations: [\n    AppComponent\n  ],\n  imports: [\n    BrowserModule,\n    AppRoutingModule,\n\n    // [...]\n    OmegleModule,\n    TypingStatusDirective\n    // [...]\n  ],\n  bootstrap: [\n    AppComponent\n  ]\n})\nexport class AppModule { }\n```\n\nIn the example, the `OmegleNPoolOpts` service is the implementation of [NPoolOpts<?>](https://nostrify.dev/relay/pool#options) interface from `@nostrify/nostrify`, as you can [read in nostrify docs](https://nostrify.dev/relay/pool), this implementation is required to routing events to correct relay and to read from desired relay. `@belomonte/nostr-ngx` will bring an [overridable implementation](https://github.com/antonioconselheiro/nostr-ngx/blob/master/projects/nostr-ngx/src/lib/pool/relay-router.service.ts) for this, but here is an example of how it was implemented in `omeglestr`:\n\n```typescript\n@Injectable()\nexport class OmegleNPoolOpts implements NPoolOpts<NRelay1> {\n\n  constructor(\n    //  in this example this is a custom service in the application that centralize user custom relay configs\n    private relayConfigService: RelayConfigService\n  ) { }\n  \n  open(url: string): NRelay1 {\n    return new NRelay1(url);\n  }\n\n  async reqRouter(filters: NostrFilter[]): Promise<Map<string, NostrFilter[]>> {\n    const toupleList: Array<[string, NostrFilter[]]> = [];\n    this.relayConfigService\n      .getConfig()\n      .forEach(relay => toupleList.push([relay, filters]));\n\n    return new Map(toupleList);\n  }\n\n  async eventRouter(): Promise<string[]> {\n    return this.relayConfigService.getConfig();\n  }\n}\n```\n\n`RelayConfigService` is a custom service from `omeglestr` that read user choosen relay, you can copy this approuch from `omeglestr`, can set the relays hardcoded or can create a custom angular service.\n\n### Find Stranger\n![Omeglestr search stranger](https://raw.githubusercontent.com/antonioconselheiro/ngx-parody-api/refs/heads/main/docs/imgs/omeglestr/1-omeglestr-search.png)\n\n\nTo find a stranger you must inject the service FindStrangerService as the example below:\n\n```typescript\nimport { FindStrangerParody } from '@belomonte/ngx-parody-api';\n\n// [...]\nexport class SearchStrangerComponent {\n\n  //  by executing controller.abort() the search for stranger will\n  //  be stopped, this can be used to allow user cancel search request\n  controller = new AbortController();\n\n  // [...]\n\n  constructor(\n    private findStrangerParody: FindStrangerParody\n  ) { }\n\n  // [...]\n\n  onClickSearchStranger(): void {\n    const stranger = await this.findStrangerParody\n      .searchStranger({\n        signal: this.controller,\n        searchTags: [ 'omegle' ], // will search for users with wannachat status indexed with #omegle\n        userTags: [ 'omegle' ] // will include in your wannachat status a tag #omegle to index it to searching strangers\n      });\n  }\n\n  abortSearchStranger(): void {\n    this.controller.abort();\n  }\n\n  // [...]\n\n}\n\n```\n\n### Status and messages\n![Omeglestr chat and status](https://raw.githubusercontent.com/antonioconselheiro/ngx-parody-api/refs/heads/main/docs/imgs/omeglestr/2-omeglestr-chat-n-status.png)\n\n\n```typescript\nimport { FindStrangerParody, NostrPublicUser, TalkToStrangerParody } from '@belomonte/ngx-parody-api';\n\n// [...]\nexport class ChatingComponent implements OnDestroy, OnInit {\n  \n  subscriptions = new Subscription();\n  strangerIsTyping = false;\n  stranger: NostrPublicUser | null = null;\n\n  messages: Array<{ pubkey: string, content: string, created_at: number }> = [];\n\n  readonly typingTimeoutAmount = 2_000;\n  typingTimeoutId = 0;\n\n  // [...]\n  constructor(\n    private talkToStrangerParody: TalkToStrangerParody,\n    private findStrangerParody: FindStrangerParody\n  ) { }\n  // [...]\n\n  ngOnInit(): void {\n    this.subscriptions.add(this.talkToStrangerParody\n      .listenMessages(stranger)\n      .subscribe({\n        next: event => {\n          this.talkToStrangerParody\n            .openEncryptedDirectMessage(stranger, event)\n            .then(content => {\n              const { pubkey, created_at } = event;\n              this.messages.push({ pubkey, content, created_at });\n            });\n        }\n      }));\n\n    this.subscriptions.add(this.talkToStrangerParody\n      .listenStrangerStatus(stranger)\n      .subscribe({\n        next: event => {\n          this.strangerIsTyping = event.content === 'typing';\n\n          //  when stranger emits disconnect status, your session will\n          //  automatically emit disconnect status too, so call .endSession\n          //  is not needed, but keeps needed to clean component data\n          if (event.content === 'disconnect') {\n            this.cleanSession();\n          }\n        }\n      }));\n  }\n\n  ngOnDestroy(): void {\n    this.subscriptions.unsubscribe();\n  }\n\n  //  [...]\n  //  send message to stranger\n  async sendMessage(stranger: NostrPublicUser, message: string): Promise<void> {\n    const typingPromise = this.talkToStrangerParody.isTyping();\n    const messagePromise = this.talkToStrangerParody.sendMessage(stranger, message);\n    await Promise.all([typingPromise, messagePromise]);\n  }\n\n  //  update typing status, must be bind into keydown event of textarea\n  onTyping(): void {\n    if (!this.typingTimeoutId) {\n      this.talkToStrangerParody.isTyping();\n    }\n\n    clearTimeout(this.typingTimeoutId);\n    this.typingTimeoutId = Number(setTimeout(() => {\n      this.talkToStrangerParody.stopTyping();\n      this.qtypingTimeoutId = 0;\n    }, this.typingTimeoutAmount));\n  }\n\n  //  clean component data when user or partner disconnect\n  cleanSession(): void {\n    this.subscriptions.unsubscribe();\n    this.subscriptions = new Subscription();\n    this.strangerIsTyping = false;\n    this.stranger = null;\n  }\n}\n```\n\n```typescript\n  <textarea\n    name=\"text\"\n    #messageField\n    (keydown.enter)=\"sendMessage(messageField.value); messageField.value = '';\"\n    parodyTypingStatus\n  ></textarea>\n```\n\n### Disconnect\n![Omeglestr disconnect](https://raw.githubusercontent.com/antonioconselheiro/ngx-parody-api/refs/heads/main/docs/imgs/omeglestr/3-omeglestr-disconnect.png)\n\n```typescript\n  //  called that when user wanna disconnect\n  endSession(): Promise<void> {\n    return this.findStrangerParody\n      .endSession()\n      .then(() => this.cleanSession());\n  }\n```","readmeFilename":"README.md"}