{"_id":"@byebot/vue","name":"@byebot/vue","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@byebot/vue","version":"1.0.0","description":"Vue 3 integration for Byebot","author":{"name":"Byebot"},"homepage":"https://byebot.de","type":"module","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.mjs","require":"./dist/server.js"}},"scripts":{"build":"vite build","dev":"vite build --watch","typecheck":"vue-tsc --noEmit","prepublishOnly":"npm run build"},"peerDependencies":{"vue":">=3.3.0"},"devDependencies":{"@vitejs/plugin-vue":"^5.0.0","typescript":"^5.3.0","vite":"^5.0.0","vite-plugin-dts":"^3.7.0","vue":"^3.4.0","vue-tsc":"^2.0.0"},"keywords":["captcha","byebot","vue","vue3","nuxt","bot-detection"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ByeBot-Integrations/Vue.git"},"gitHead":"198751c7725497806d38105ef702d68406390d8f","_id":"@byebot/vue@1.0.0","bugs":{"url":"https://github.com/ByeBot-Integrations/Vue/issues"},"_nodeVersion":"22.22.2","_npmVersion":"11.12.0","dist":{"integrity":"sha512-xjDYH5Tcl3cRIcIz6w80tx7cs9Nfyb9dpioawfhmPrph9zW+Ykgy0Q92GoSy44pnZ9hgU8I8duvWJl/qKYozPg==","shasum":"4e3945b09c7d148e6cd3ce61ecf0fa97aa0704b5","tarball":"https://registry.npmjs.org/@byebot/vue/-/vue-1.0.0.tgz","fileCount":17,"unpackedSize":21915,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICmmHJHBQSfnMdNEhWItFpGwhBhmfy1k3sK92LFP00oWAiEA2l0jE4mFlbW35cJvFjGWIUa0nTWndFalfMvituSP1p4="}]},"_npmUser":{"name":"shigshag","email":"schlusseldieb@gmail.com"},"directories":{},"maintainers":[{"name":"shigshag","email":"schlusseldieb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vue_1.0.0_1774555059577_0.5090280934036622"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-26T19:57:39.459Z","1.0.0":"2026-03-26T19:57:39.725Z","modified":"2026-03-26T19:57:39.927Z"},"maintainers":[{"name":"shigshag","email":"schlusseldieb@gmail.com"}],"description":"Vue 3 integration for Byebot","homepage":"https://byebot.de","keywords":["captcha","byebot","vue","vue3","nuxt","bot-detection"],"repository":{"type":"git","url":"git+https://github.com/ByeBot-Integrations/Vue.git"},"author":{"name":"Byebot"},"bugs":{"url":"https://github.com/ByeBot-Integrations/Vue/issues"},"license":"MIT","readme":"# @byebot/vue\n\nVue 3 integration for Byebot.\n\nGitHub: https://github.com/ByeBot-Integrations/Vue\n\n## Installation\n\n```bash\nnpm install @byebot/vue\n```\n\n## Usage\n\n### Basic Form\n\nThe captcha widget automatically adds a hidden `byebot-token` field to the parent form.\n\n```vue\n<template>\n  <form action=\"/api/login\" method=\"POST\">\n    <input name=\"email\" type=\"email\" />\n    <input name=\"password\" type=\"password\" />\n    <Byebot site-key=\"your-site-key\" />\n    <button type=\"submit\">Login</button>\n  </form>\n</template>\n\n<script setup>\nimport { Byebot } from \"@byebot/vue\";\n</script>\n```\n\n### With Callback\n\nUse `@verify` event to know when verification completes.\n\n```vue\n<template>\n  <Byebot site-key=\"your-site-key\" @verify=\"handleVerify\" />\n</template>\n\n<script setup>\nconst handleVerify = (token: string) => {\n  console.log('Verified!', token)\n}\n</script>\n```\n\n## Server-Side Validation\n\n```ts\n// Nuxt 3: server/api/login.post.ts\nimport { validateByebotToken } from \"@byebot/vue/server\";\n\nexport default defineEventHandler(async (event) => {\n  const body = await readBody(event);\n  const token = body[\"byebot-token\"];\n\n  const result = await validateByebotToken({\n    apiKey: process.env.BYEBOT_API_KEY!,\n    token,\n  });\n\n  if (!result.valid) {\n    throw createError({ statusCode: 403, message: \"Captcha failed\" });\n  }\n\n  // Proceed with login...\n});\n```\n\n## API\n\n### `<Byebot />`\n\n| Prop       | Type     | Required | Description                      |\n| ---------- | -------- | -------- | -------------------------------- |\n| `site-key` | `string` | Yes      | Your site key from the dashboard |\n\n| Event    | Payload  | Description                     |\n| -------- | -------- | ------------------------------- |\n| `verify` | `string` | Emitted on verification success |\n\n### `validateByebotToken(options)`\n\n| Option   | Type     | Required |\n| -------- | -------- | -------- |\n| `apiKey` | `string` | Yes      |\n| `token`  | `string` | Yes      |\n\nReturns: `Promise<{ valid: boolean, message?: string, rawResponse?: unknown }>`\n","readmeFilename":"README.md","_rev":"1-41a777a0a20768a83ad531f11acab929"}