{"_id":"@agree-able/invite","_rev":"4-cbac68ac5b9c9df3f331bd569c5722ed","name":"@agree-able/invite","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@agree-able/invite","version":"1.0.0","author":{"name":"Ryan Ramage"},"license":"ISC","_id":"@agree-able/invite@1.0.0","maintainers":[{"name":"eckoit","email":"ryan.ramage@gmail.com"}],"homepage":"https://github.com/agree-able/invite#readme","bugs":{"url":"https://github.com/agree-able/invite/issues"},"dist":{"shasum":"f9a5c6008f48246bf6a51f37067f03bd47e80709","tarball":"https://registry.npmjs.org/@agree-able/invite/-/invite-1.0.0.tgz","fileCount":12,"integrity":"sha512-pn+dU97LVhdgynYDzm5DyiaaS7Udv+axfRACw9csASxWhf7Hc7y9BGDyUfQ4CPIdf4kZe9UvOjJ7gLYySfo2Pg==","signatures":[{"sig":"MEUCIDNpL+Ubep43QzF+ksNztki3YmZTzlq1JN4I+c1pZgWcAiEAw2DeIlgk+jWnIN8v+xbkCGTNH0Zk6hcu6Ny+4fm4AIw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28582},"main":"index.mjs","gitHead":"47410ceb003a9c8d56fb44cb1d4c3d30a5ba1232","scripts":{"fix":"standard --fix","test":"standard && tap run"},"_npmUser":{"name":"eckoit","email":"ryan.ramage@gmail.com"},"repository":{"url":"git+https://github.com/agree-able/invite.git","type":"git"},"_npmVersion":"10.7.0","description":"simple ways to get an invite to a room","directories":{},"_nodeVersion":"20.14.0","dependencies":{"openpgp":"^6.0.1","node-fetch":"^3.3.2","@agree-able/rpc":"^3.0.0","@agree-able/contract":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^21.0.1","nock":"^13.5.6","standard":"^17.1.2"},"_npmOperationalInternal":{"tmp":"tmp/invite_1.0.0_1732832284183_0.3964354420329623","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@agree-able/invite","version":"1.0.1","author":{"name":"Ryan Ramage"},"license":"ISC","_id":"@agree-able/invite@1.0.1","maintainers":[{"name":"eckoit","email":"ryan.ramage@gmail.com"}],"homepage":"https://github.com/agree-able/invite#readme","bugs":{"url":"https://github.com/agree-able/invite/issues"},"dist":{"shasum":"813eaa37cd261c4f1cfba1621e276b62e7232083","tarball":"https://registry.npmjs.org/@agree-able/invite/-/invite-1.0.1.tgz","fileCount":12,"integrity":"sha512-9L2YrvjONo5Y9O8ArZIpgFsy4AKHJtyDuXCcU9DHbg8bh2pNqM0cSvhrMpjrfIg+AAGcxmLEynBgwZc1VQHS/w==","signatures":[{"sig":"MEYCIQCmMqSRvRJnZbLLEKZOaEOP0igxBh5f+9R44fA8J19V7QIhAOaa8z3nDkI/COe56WH9nBKKsQ+LlIfQnNVAGu/6knxB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28857},"main":"index.mjs","gitHead":"f19266fde4833f746c07f8a9bcc8763d2b8a3137","scripts":{"fix":"standard --fix","test":"standard && tap run"},"_npmUser":{"name":"eckoit","email":"ryan.ramage@gmail.com"},"repository":{"url":"git+https://github.com/agree-able/invite.git","type":"git"},"_npmVersion":"10.7.0","description":"simple ways to get an invite to a room","directories":{},"_nodeVersion":"20.14.0","dependencies":{"openpgp":"^6.0.1","node-fetch":"^3.3.2","@agree-able/rpc":"^3.0.0","@agree-able/contract":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^21.0.1","nock":"^13.5.6","standard":"^17.1.2"},"_npmOperationalInternal":{"tmp":"tmp/invite_1.0.1_1732833019637_0.42568697051307636","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@agree-able/invite","version":"1.0.2","author":{"name":"Ryan Ramage"},"license":"ISC","_id":"@agree-able/invite@1.0.2","maintainers":[{"name":"eckoit","email":"ryan.ramage@gmail.com"}],"homepage":"https://github.com/agree-able/invite#readme","bugs":{"url":"https://github.com/agree-able/invite/issues"},"dist":{"shasum":"eac9d00fd5bad8313838bacec719bdb9dd042ee8","tarball":"https://registry.npmjs.org/@agree-able/invite/-/invite-1.0.2.tgz","fileCount":12,"integrity":"sha512-CiOHgUDQ7mtiAOJlGbGfkDbMOyG4zYq0972TOdmaywjIhz+ymSwmr1+MjL9+2yjEXK85G+HCnZExp3NeUtIzYw==","signatures":[{"sig":"MEYCIQDOx66NHDwcaxrCjc4Zz7Bf8hf1UxQCFjk2Tb8gw1rLFgIhAJ7HnoL+Ku3FQrFm6pn+BOci2ge2bcvCv6iVzdAHyjM+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28860},"main":"index.mjs","gitHead":"e3a7cb479ca4d01dc69c0191777522bb3026d73c","scripts":{"fix":"standard --fix","test":"standard && tap run"},"_npmUser":{"name":"eckoit","email":"ryan.ramage@gmail.com"},"repository":{"url":"git+https://github.com/agree-able/invite.git","type":"git"},"_npmVersion":"10.7.0","description":"simple ways to get an invite to a room","directories":{},"_nodeVersion":"20.14.0","dependencies":{"openpgp":"^6.0.1","node-fetch":"^3.3.2","@agree-able/rpc":"^3.0.0","@agree-able/contract":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^21.0.1","nock":"^13.5.6","standard":"^17.1.2"},"_npmOperationalInternal":{"tmp":"tmp/invite_1.0.2_1732993372678_0.8735891180440871","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@agree-able/invite","version":"1.0.3","author":{"name":"Ryan Ramage"},"license":"ISC","_id":"@agree-able/invite@1.0.3","maintainers":[{"name":"eckoit","email":"ryan.ramage@gmail.com"}],"homepage":"https://github.com/agree-able/invite#readme","bugs":{"url":"https://github.com/agree-able/invite/issues"},"dist":{"shasum":"bb1d9cc62edcda3d1b29dc40d899bcc6f93dcfb6","tarball":"https://registry.npmjs.org/@agree-able/invite/-/invite-1.0.3.tgz","fileCount":12,"integrity":"sha512-IB5Co6OB+6JXYgZmoYCtfM9dC9fFVRMkMkV7lqvTPpAUbKQDKJee8EAWd860WWn0mvpviAwDpagaw+ChkOhJlA==","signatures":[{"sig":"MEYCIQCLj0HPy3ueFdBN/w9WBVD3Og7hBEX0sFOwQD8uk6iHGAIhAJYNwxfrUgbFEzz/Z6gYZjO8UTYVSxaakE74iSDAY1YV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28839},"main":"index.mjs","gitHead":"7f2470cf57ed0d5dee010a30e358e457320115f2","scripts":{"fix":"standard --fix","test":"standard && tap run"},"_npmUser":{"name":"eckoit","email":"ryan.ramage@gmail.com"},"repository":{"url":"git+https://github.com/agree-able/invite.git","type":"git"},"_npmVersion":"10.7.0","description":"simple ways to get an invite to a room","directories":{},"_nodeVersion":"20.14.0","dependencies":{"openpgp":"^6.0.1","node-fetch":"^3.3.2","@agree-able/rpc":"^3.0.0","@agree-able/contract":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^21.0.1","nock":"^13.5.6","standard":"^17.1.2"},"_npmOperationalInternal":{"tmp":"tmp/invite_1.0.3_1733018353985_0.12921132424905668","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"@agree-able/invite","version":"1.0.4","description":"simple ways to get an invite to a room","main":"index.mjs","scripts":{"test":"standard && tap run","fix":"standard --fix"},"repository":{"type":"git","url":"git+https://github.com/agree-able/invite.git"},"author":{"name":"Ryan Ramage"},"license":"ISC","bugs":{"url":"https://github.com/agree-able/invite/issues"},"homepage":"https://github.com/agree-able/invite#readme","dependencies":{"@agree-able/contract":"^2.0.0","@agree-able/rpc":"^3.0.0","node-fetch":"^3.3.2","openpgp":"^6.0.1"},"devDependencies":{"nock":"^13.5.6","standard":"^17.1.2","tap":"^21.0.1"},"_id":"@agree-able/invite@1.0.4","gitHead":"d8117515505dd627ca14ed7fb7d960966a103b3e","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-DlusjnfLc4F2m7GtgUjs6/mT8mWavY79R1wav+gyzpLWsxwSItoco6K6iLXhwGGLKt+Z1DAzQQdNRm8P9RB5IQ==","shasum":"29447e55b2be96db4694a6f6349b9486a205c823","tarball":"https://registry.npmjs.org/@agree-able/invite/-/invite-1.0.4.tgz","fileCount":12,"unpackedSize":28997,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5VxBG5fGEJdaFaJh2D0Y8VXQBQvmfi4BqXwnB3U2SyAIgNuGJFIqXHk+ruhGTWkQp1M4bzCz7vcwY67b8m1v8APo="}]},"_npmUser":{"name":"eckoit","email":"ryan.ramage@gmail.com"},"directories":{},"maintainers":[{"name":"eckoit","email":"ryan.ramage@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/invite_1.0.4_1733801892461_0.07931825738218135"},"_hasShrinkwrap":false}},"time":{"created":"2024-11-28T22:18:04.064Z","modified":"2024-12-10T03:38:12.896Z","1.0.0":"2024-11-28T22:18:04.382Z","1.0.1":"2024-11-28T22:30:19.786Z","1.0.2":"2024-11-30T19:02:52.880Z","1.0.3":"2024-12-01T01:59:14.150Z","1.0.4":"2024-12-10T03:38:12.676Z"},"bugs":{"url":"https://github.com/agree-able/invite/issues"},"author":{"name":"Ryan Ramage"},"license":"ISC","homepage":"https://github.com/agree-able/invite#readme","repository":{"type":"git","url":"git+https://github.com/agree-able/invite.git"},"description":"simple ways to get an invite to a room","maintainers":[{"name":"eckoit","email":"ryan.ramage@gmail.com"}],"readme":"# Agreeable Room Invitations \n\nA utility for loading and configuring room settings with support for invites, domain-based configuration, and identity verification through Keybase.\n\n## Installation\n\n```bash\nnpm install @agree-able/invite\n```\n\n## Quick Start\n\n```javascript\nimport { load } from '@agree-able/invite'\n\n// Simple usage with direct invite\nconst config = { invite: 'your-invite-code' }\nconst result = await load(config, confirmEnterRoom)\n\n// Domain-based configuration with DID lookup\nconst config = { \n  domain: 'example.com',\n  loadDid: true\n}\nconst result = await load(config, confirmEnterRoom)\n\n// With Keybase verification\nconst config = {\n  domain: 'example.com',\n  keybaseUsername: 'username',\n  privateKeyArmored: 'your-pgp-key'\n}\nconst result = await load(config, confirmEnterRoom)\n```\n\n## The confirmEnterRoom Function\n\nThe `confirmEnterRoom` function is required and must handle room entry expectations. It receives room expectations and host details, and should return an acceptance object.\n\n```javascript\nconst confirmEnterRoom = async (expectations, hostDetails) => {\n  // expectations contains room requirements\n  // hostDetails may contain verification details if whoami is enabled\n  \n  console.log('room rules', expectations.rules)\n  console.log('room reason', expectations.reason)\n\n  // Example of checking whoami verification\n  if (hostDetails?.whoami?.keybase) {\n    const { verified, username } = hostDetails.whoami.keybase\n    if (!verified) {\n      throw new Error(`Keybase verification failed for ${username}`)\n    }\n  }\n\n  // you must return the acceptance object back to the server\n  return {\n    reason: true, // 'agree to the reason for the room'\n    rules: true // 'agree to the rules for the room'\n  }\n}\n```\n\n## Key Features\n\n- Direct invite code support\n- Domain-based room key lookup\n- DID (Decentralized Identifier) resolution\n- Keybase identity verification\n- PGP signing support\n\n## Configuration Options\n\nThe `load` function accepts a configuration object with the following options:\n\n- `invite`: Direct invite code (z32 string)\n- `domain`: Domain to lookup breakout room key from\n- `loadDid`: Whether to load DID from domain\n- `hostProveWhoami`: Enable host whoami verification\n- `keybaseUsername`: Keybase username for verification\n- `privateKeyArmoredFile`: File location of PGP private key\n- `privateKeyArmored`: PGP private key in armored format\n\n## Returns\n\nThe function returns a Promise resolving to an object containing:\n- `invite`: The room invite code\n- `did`: The DID (if requested and available)\n\n## License\n\nMIT\n","readmeFilename":"README.md"}