{"_id":"@authyo/auth-vue","name":"@authyo/auth-vue","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@authyo/auth-vue","version":"1.0.0","description":"Vue wrapper for the Authyo passwordless SDK.","license":"MIT","author":{"name":"Authyo"},"main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"sideEffects":false,"scripts":{"build":"tsc -p tsconfig.json","clean":"rimraf dist"},"peerDependencies":{"vue":"^3.0.0","@authyo/auth-js":"^1.0.0"},"devDependencies":{"@types/node":"^20.0.0","rimraf":"^5.0.5","typescript":"^5.6.3","vue":"^3.4.0"},"repository":{"type":"git","url":"git+https://github.com/authyo/auth-vue.git"},"bugs":{"url":"https://github.com/authyo/auth-vue/issues"},"homepage":"https://authyo.io/docs","keywords":["authyo","authentication","auth","passwordless","otp","webauthn","vue","vue3","identity","security","typescript"],"engines":{"node":">=16"},"_id":"@authyo/auth-vue@1.0.0","gitHead":"df4685a2314d2e2f2836fa6396f3202fc68661cb","_nodeVersion":"22.13.0","_npmVersion":"11.5.2","dist":{"integrity":"sha512-OmwRKVPRCJ6BFRWt/DY4hSnjK4+9w2FMgIWnUETXOC3B4WkszjfPxCveOc5ACI9mOX518Z25twHHdZkrECUHkA==","shasum":"96c000fd09a25f9579168eb79bada7255fe2328f","tarball":"https://registry.npmjs.org/@authyo/auth-vue/-/auth-vue-1.0.0.tgz","fileCount":14,"unpackedSize":8774,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBzRwQ8Sj4MgGcJm/kQyAv7sj2plP14iCS7RvynKPZhhAiBZkaOUfLjrOnh7lgzF1f+2YFFwWCcl3zsSxvBXvrHYSQ=="}]},"_npmUser":{"name":"konceptwise","email":"mayur@smsidea.co.in"},"directories":{},"maintainers":[{"name":"konceptwise","email":"mayur@smsidea.co.in"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/auth-vue_1.0.0_1765366456421_0.7785368999036932"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-10T11:34:16.349Z","1.0.0":"2025-12-10T11:34:16.567Z","modified":"2025-12-10T11:34:16.821Z"},"maintainers":[{"name":"konceptwise","email":"mayur@smsidea.co.in"}],"description":"Vue wrapper for the Authyo passwordless SDK.","homepage":"https://authyo.io/docs","keywords":["authyo","authentication","auth","passwordless","otp","webauthn","vue","vue3","identity","security","typescript"],"repository":{"type":"git","url":"git+https://github.com/authyo/auth-vue.git"},"author":{"name":"Authyo"},"bugs":{"url":"https://github.com/authyo/auth-vue/issues"},"license":"MIT","readme":"# @authyo/auth-vue\r\n\r\nVue 3 wrapper for the Authyo passwordless authentication SDK.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @authyo/auth-vue @authyo/auth-js\r\n```\r\n\r\n## Quick Start\r\n\r\n### 1. Install the Plugin\r\n\r\nIn your main app file (e.g., `main.ts`):\r\n\r\n```typescript\r\nimport { createApp } from 'vue';\r\nimport { AuthyoPlugin } from '@authyo/auth-vue';\r\nimport App from './App.vue';\r\n\r\nconst app = createApp(App);\r\n\r\napp.use(AuthyoPlugin, {\r\n  clientId: 'YOUR_CLIENT_ID',\r\n  clientSecret: 'YOUR_CLIENT_SECRET',\r\n  baseUrl: 'https://app.authyo.io' // optional, defaults to https://app.authyo.io\r\n});\r\n\r\napp.mount('#app');\r\n```\r\n\r\n### 2. Use in Components\r\n\r\nUse the `useAuthyo` composable in your Vue components:\r\n\r\n```vue\r\n<template>\r\n  <div>\r\n    <button @click=\"sendOtp\">Send OTP</button>\r\n    <button @click=\"verifyOtp\" :disabled=\"!otp\">Verify OTP</button>\r\n  </div>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { ref } from 'vue';\r\nimport { useAuthyo } from '@authyo/auth-vue';\r\n\r\nconst authyo = useAuthyo();\r\nconst otp = ref('');\r\n\r\nconst sendOtp = async () => {\r\n  try {\r\n    const result = await authyo.sendOtp({\r\n      to: 'user@example.com',\r\n      authWay: 'Email',\r\n      otpLength: 6\r\n    });\r\n    console.log('OTP sent:', result);\r\n  } catch (error) {\r\n    console.error('Failed to send OTP:', error);\r\n  }\r\n};\r\n\r\nconst verifyOtp = async () => {\r\n  try {\r\n    const result = await authyo.verifyOtp(otp.value, 'mask-id-from-send-otp');\r\n    console.log('OTP verified:', result);\r\n  } catch (error) {\r\n    console.error('Failed to verify OTP:', error);\r\n  }\r\n};\r\n</script>\r\n```\r\n\r\n## API\r\n\r\n### `useAuthyo()`\r\n\r\nReturns the `AuthyoClient` instance. Must be used within a component tree that has `AuthyoPlugin` installed.\r\n\r\n**Returns:** `AuthyoClient`\r\n\r\n**Throws:** Error if used outside of AuthyoPlugin setup\r\n\r\n### AuthyoClient Methods\r\n\r\nAll methods return Promises that resolve to `AuthyoApiEnvelope<T>`:\r\n\r\n- `getConfiguration()` - Get application customization configuration\r\n- `sendOtp({ to, authWay, otpLength, expiry, deviceInfo })` - Send OTP to user\r\n- `verifyOtp(otp, maskId)` - Verify OTP code\r\n- `verifyToken(token)` - Verify authentication token\r\n- `revokeSession(token)` - Revoke user session\r\n\r\n## TypeScript Support\r\n\r\nThis package is written in TypeScript and includes full type definitions.\r\n\r\n## Requirements\r\n\r\n- Vue 3.0+\r\n- @authyo/auth-js 1.0.0+\r\n\r\n## Documentation\r\n\r\nFor more information, visit [https://authyo.io/docs](https://authyo.io/docs)\r\n\r\n## License\r\n\r\nMIT License\r\n\r\n","readmeFilename":"README.md","_rev":"1-e33d63a27cc786bcfa24e27d1da57804"}