{"_id":"@bitsocial/voucher-challenge","_rev":"5-0709506294f6c9c83aaa430d28d81bb3","name":"@bitsocial/voucher-challenge","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@bitsocial/voucher-challenge","version":"0.1.0","keywords":["bitsocial","plebbit","pkc","challenge","voucher"],"author":{"name":"Rinse"},"license":"GPL-3.0-only","_id":"@bitsocial/voucher-challenge@0.1.0","maintainers":[{"name":"rinse12","email":"rinse12@tutanota.com"},{"name":"tomcasaburi","email":"tom@plebbitlabs.com"}],"homepage":"https://github.com/bitsocialnet/voucher-challenge#readme","bugs":{"url":"https://github.com/bitsocialnet/voucher-challenge/issues"},"dist":{"shasum":"b85d01e56e4b006cabacb6f97554a478774ab800","tarball":"https://registry.npmjs.org/@bitsocial/voucher-challenge/-/voucher-challenge-0.1.0.tgz","fileCount":13,"integrity":"sha512-FFFjq79Kn7TM2lw+u5OGsy0C2TLi93CGBhGby9VFXEctsgIVKStJoFwCLo9AjdKiwiY8pFuDZL409sDUziL+VA==","signatures":[{"sig":"MEUCICkGIIh48X0b7Xq6zNEYh/xU52DaHFRsrGof1h/Es+9JAiEA6c064b0kf9DFoTMAs3NGeQOtAcQmOl+0qrPl70GWMz4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":51258},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","config":{"commitizen":{"path":"cz-conventional-changelog"}},"engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"3ae8392070ec5c6f3f8d17eca22afc89fea63595","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","prepare":"husky","release":"HUSKY=0 release-it --config config/.release-it.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"rinse12","email":"rinse12@tutanota.com"},"repository":{"url":"git+https://github.com/bitsocialnet/voucher-challenge.git","type":"git"},"_npmVersion":"10.9.4","description":"Standalone voucher challenge for pkc-js","directories":{},"_nodeVersion":"22.22.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"husky":"9.1.7","remeda":"2.29.0","vitest":"4.0.18","commitizen":"4.3.1","release-it":"19.2.4","typescript":"5.9.3","@types/node":"25.3.5","@commitlint/cli":"20.4.3","@pkcprotocol/pkc-js":"0.0.11","cz-conventional-changelog":"3.3.0","@commitlint/config-conventional":"20.4.3","@release-it/conventional-changelog":"10.0.5"},"_npmOperationalInternal":{"tmp":"tmp/voucher-challenge_0.1.0_1775814822073_0.9017118629229812","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@bitsocial/voucher-challenge","version":"0.1.1","keywords":["bitsocial","plebbit","pkc","challenge","voucher"],"author":{"name":"Rinse"},"license":"GPL-3.0-only","_id":"@bitsocial/voucher-challenge@0.1.1","maintainers":[{"name":"rinse12","email":"rinse12@tutanota.com"}],"homepage":"https://github.com/bitsocialnet/voucher-challenge#readme","bugs":{"url":"https://github.com/bitsocialnet/voucher-challenge/issues"},"dist":{"shasum":"2d7d021c741276ad7ca4222a2773d9d2a708c718","tarball":"https://registry.npmjs.org/@bitsocial/voucher-challenge/-/voucher-challenge-0.1.1.tgz","fileCount":13,"integrity":"sha512-8wWxaIuZoyfu5XID+YQDg6pAO+g/RxO/na9gJWOKuPSK9U9GJ/qqJZ1PiB8c9YXFl+XTtzz3a07PBBYPCFtFPw==","signatures":[{"sig":"MEQCIBajnvFBRYo1Od/fF7alcmOEbhjm1amL58/CDL8VOP4dAiAKdhREPlkehndoMAU7qMFdKhLlWqU83QW1BER/5dtdzw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bitsocial%2fvoucher-challenge@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":51258},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","config":{"commitizen":{"path":"cz-conventional-changelog"}},"engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"31b48e20151b6a45fcfa68147e08751cf14bc010","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","prepare":"husky","release":"HUSKY=0 release-it --config config/.release-it.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:297c235c-ff14-4e1e-b8f8-b2c4c51a6c1b"}},"repository":{"url":"git+https://github.com/bitsocialnet/voucher-challenge.git","type":"git"},"_npmVersion":"11.12.1","description":"Standalone voucher challenge for pkc-js","directories":{},"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"husky":"9.1.7","remeda":"2.29.0","vitest":"4.0.18","commitizen":"4.3.1","release-it":"19.2.4","typescript":"5.9.3","@types/node":"25.3.5","@commitlint/cli":"20.4.3","@pkcprotocol/pkc-js":"0.0.11","cz-conventional-changelog":"3.3.0","@commitlint/config-conventional":"20.4.3","@release-it/conventional-changelog":"10.0.5"},"_npmOperationalInternal":{"tmp":"tmp/voucher-challenge_0.1.1_1775815711417_0.9095039247414483","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@bitsocial/voucher-challenge","version":"0.1.2","keywords":["bitsocial","plebbit","pkc","challenge","voucher"],"author":{"name":"Rinse"},"license":"GPL-3.0-or-later","_id":"@bitsocial/voucher-challenge@0.1.2","maintainers":[{"name":"rinse12","email":"rinse12@tutanota.com"}],"homepage":"https://github.com/bitsocialnet/voucher-challenge#readme","bugs":{"url":"https://github.com/bitsocialnet/voucher-challenge/issues"},"dist":{"shasum":"6766f5e0e8bf8f78a746ecf1687c28e32503cc5b","tarball":"https://registry.npmjs.org/@bitsocial/voucher-challenge/-/voucher-challenge-0.1.2.tgz","fileCount":13,"integrity":"sha512-cWKVc6uz/y7aoltK0QGtT7UsqHFhT2O9ozGFGe6Gx52atDLszxvryAuS4rESkMcZ1Car7SMx1hVwRpxXjJ2ADQ==","signatures":[{"sig":"MEUCIB6Qop6W3t5jiWWzMYrCG7RxhEf/qtvkKpQeNq0BKPnFAiEA9Vkh5HVwE1mx4DqSLHwg0YZUbMxI2mwaBJHJYySANzA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bitsocial%2fvoucher-challenge@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":51960},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","config":{"commitizen":{"path":"cz-conventional-changelog"}},"engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"0e8198875c03499c0fee6a81061d2781fe0b1bdd","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","prepare":"husky","release":"HUSKY=0 release-it --config config/.release-it.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:297c235c-ff14-4e1e-b8f8-b2c4c51a6c1b"}},"repository":{"url":"git+https://github.com/bitsocialnet/voucher-challenge.git","type":"git"},"_npmVersion":"11.12.1","description":"Standalone voucher challenge for pkc-js","directories":{},"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"husky":"9.1.7","remeda":"2.29.0","vitest":"4.0.18","commitizen":"4.3.1","release-it":"19.2.4","typescript":"5.9.3","@types/node":"25.3.5","@commitlint/cli":"20.4.3","@pkcprotocol/pkc-js":"0.0.11","cz-conventional-changelog":"3.3.0","@commitlint/config-conventional":"20.4.3","@release-it/conventional-changelog":"10.0.5"},"_npmOperationalInternal":{"tmp":"tmp/voucher-challenge_0.1.2_1775822468508_0.9493257500540146","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@bitsocial/voucher-challenge","version":"0.1.3","description":"Standalone voucher challenge for pkc-js","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"build":"tsc -p tsconfig.build.json","typecheck":"tsc -p tsconfig.json --noEmit","test":"vitest run","test:watch":"vitest","clean":"rm -rf dist","prepare":"husky","release":"HUSKY=0 release-it --config config/.release-it.json"},"keywords":["bitsocial","plebbit","pkc","challenge","voucher"],"author":{"name":"Rinse"},"license":"GPL-3.0-or-later","repository":{"type":"git","url":"git+https://github.com/bitsocialnet/voucher-challenge.git"},"publishConfig":{"access":"public"},"engines":{"node":">=22.0.0"},"devDependencies":{"@commitlint/cli":"20.4.3","@commitlint/config-conventional":"20.4.3","@pkcprotocol/pkc-js":"0.0.11","@release-it/conventional-changelog":"10.0.5","@types/node":"25.3.5","commitizen":"4.3.1","cz-conventional-changelog":"3.3.0","husky":"9.1.7","release-it":"19.2.4","remeda":"2.29.0","typescript":"5.9.3","vitest":"4.0.18"},"config":{"commitizen":{"path":"cz-conventional-changelog"}},"gitHead":"b6be93655ae06f3b7c82288dbef155b6ffc8da21","_id":"@bitsocial/voucher-challenge@0.1.3","bugs":{"url":"https://github.com/bitsocialnet/voucher-challenge/issues"},"homepage":"https://github.com/bitsocialnet/voucher-challenge#readme","_nodeVersion":"22.22.2","_npmVersion":"11.13.0","dist":{"integrity":"sha512-4htVlzAqadEMVc6w2wBiz421rdMiNWGw+1mhDh3bRUjiqg1CGI/IiYwUuhswvyjmsQJqa63DKOPSrWV8Z9OPAg==","shasum":"5ab65bf04eb0f277f6f648092eb71417abaa492f","tarball":"https://registry.npmjs.org/@bitsocial/voucher-challenge/-/voucher-challenge-0.1.3.tgz","fileCount":13,"unpackedSize":52784,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bitsocial%2fvoucher-challenge@0.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDhUMeES9H25uwDKGciWzepmNfCKSV2MACIPHamHlFfaQIgBNqa1uNnYP2zOHfjfGeNrG/yMu0B7QR2IU1eHT4b8IA="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:297c235c-ff14-4e1e-b8f8-b2c4c51a6c1b"}},"directories":{},"maintainers":[{"name":"tomcasaburi","email":"tom@plebbitlabs.com"},{"name":"rinse12","email":"rinse12@tutanota.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/voucher-challenge_0.1.3_1777024220380_0.8088945379523951"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-10T09:53:41.940Z","modified":"2026-04-24T09:50:20.829Z","0.1.0":"2026-04-10T09:53:42.242Z","0.1.1":"2026-04-10T10:08:31.582Z","0.1.2":"2026-04-10T12:01:08.649Z","0.1.3":"2026-04-24T09:50:20.508Z"},"bugs":{"url":"https://github.com/bitsocialnet/voucher-challenge/issues"},"author":{"name":"Rinse"},"license":"GPL-3.0-or-later","homepage":"https://github.com/bitsocialnet/voucher-challenge#readme","keywords":["bitsocial","plebbit","pkc","challenge","voucher"],"repository":{"type":"git","url":"git+https://github.com/bitsocialnet/voucher-challenge.git"},"description":"Standalone voucher challenge for pkc-js","maintainers":[{"name":"tomcasaburi","email":"tom@plebbitlabs.com"},{"name":"rinse12","email":"rinse12@tutanota.com"}],"readme":"# @bitsocial/voucher-challenge\n\nStandalone voucher challenge extracted from `plebbit-js`, packaged with independent dependencies.\n\n## How it works\n\nCommunity owners configure a list of voucher codes on their community. When a user publishes for the first time, they are prompted to enter a voucher code. Once redeemed, the voucher becomes permanently bound to the user's `author.address` — that author can continue using the same voucher for future publications (posts, replies, votes), but no other author can claim it. This prevents voucher sharing across different users.\n\n## Requirements\n\n- Node.js `>=22`\n- ESM-only environment\n\n## Install\n\n### With bitsocial-cli\n\n```bash\nbitsocial challenge install @bitsocial/voucher-challenge\n```\n\nEdit your community to use the challenge:\n\n```bash\nbitsocial community edit your-community.bso \\\n  '--settings.challenges[0].name' @bitsocial/voucher-challenge \\\n  '--settings.challenges[0].options.vouchers' 'VOUCHER1,VOUCHER2,VOUCHER3'\n```\n\n### With pkc-js over RPC\n\nIf your RPC server is already running, first install the challenge on the server:\n\n```bash\nbitsocial challenge install @bitsocial/voucher-challenge\n```\n\nThen from your RPC client, connect and set the challenge on your community by name — no npm install or challenge registration needed on the client side:\n\n```ts\nimport PKC from \"@pkcprotocol/pkc-js\";\n\nconst pkc = await PKC({\n  pkcRpcClientsOptions: [\"ws://localhost:9138\"]\n});\n\nconst community = await pkc.createCommunity({ address: \"your-community-address.bso\" });\n\nawait community.edit({\n  settings: {\n    challenges: [\n      {\n        name: \"@bitsocial/voucher-challenge\",\n        options: {\n          vouchers: \"VOUCHER1,VOUCHER2,VOUCHER3\"\n        }\n      }\n    ]\n  }\n});\n```\n\n### With pkc-js (TypeScript)\n\nIf you are running your own node locally without connecting over RPC, you can install via npm and register the challenge manually:\n\n```bash\nnpm install @bitsocial/voucher-challenge\n```\n\n```ts\nimport PKC from \"@pkcprotocol/pkc-js\";\nimport { voucherChallenge } from \"@bitsocial/voucher-challenge\";\n\nPKC.challenges[\"@bitsocial/voucher-challenge\"] = voucherChallenge;\n```\n\nThen set the challenge on your community:\n\n```ts\nawait community.edit({\n  settings: {\n    challenges: [\n      {\n        name: \"@bitsocial/voucher-challenge\",\n        options: {\n          vouchers: \"VOUCHER1,VOUCHER2,VOUCHER3\"\n        }\n      }\n    ]\n  }\n});\n```\n\n## Challenge Options\n\nAll option values must be strings.\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `question` | `\"What is your voucher code?\"` | The interactive prompt the user is asked to type an answer to |\n| `vouchers` | *(required)* | Comma-separated list of voucher codes |\n| `description` | — | Informational text shown in the UI explaining what the challenge is about |\n| `invalidVoucherError` | Default message | Error shown for invalid voucher codes |\n| `alreadyRedeemedError` | Default message | Error shown when a voucher is already redeemed by another author |\n\n## Scripts\n\n```bash\nnpm run typecheck\nnpm run build\nnpm test\n```\n","readmeFilename":"README.md"}