{"_id":"@darragh-king/react-firebase-phone-auth","_rev":"3-9d9835995ce33bb58ed71183d30b4921","name":"@darragh-king/react-firebase-phone-auth","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"@darragh-king/react-firebase-phone-auth","version":"1.0.0","keywords":["react","firebase","phone-auth","authentication","phone-number","otp","sms","verification","firebase-auth","react-component","auth-provider"],"author":"","license":"MIT","_id":"@darragh-king/react-firebase-phone-auth@1.0.0","maintainers":[{"name":"darragh-king","email":"darraghking@gmail.com"}],"homepage":"https://github.com/yourusername/react-firebase-phone-auth#readme","bugs":{"url":"https://github.com/yourusername/react-firebase-phone-auth/issues"},"dist":{"shasum":"c379810cd3fb8c6e8fb392a073dcb980f0de8ed5","tarball":"https://registry.npmjs.org/@darragh-king/react-firebase-phone-auth/-/react-firebase-phone-auth-1.0.0.tgz","fileCount":7,"integrity":"sha512-EQpAW1E46eD8B8aXWSdNItGkoGPjyARzzCiYCk7rq/47GhY4wmaPmcENYCBsoYwK4xY3OKXz4yvY8Y/Ir8RLnA==","signatures":[{"sig":"MEUCIQDrTl+wXA9NCqaGC+EHktCe8nhH31/znH7x9YPOaEBN1AIgaUCpSg8woDfOHKpfgCqM864mxUnC6tPrY0wzMrjcOiU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1052434},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.esm.js","scripts":{"dev":"rollup -c -w","test":"jest","build":"rollup -c","prepublishOnly":"npm run build"},"_npmUser":{"name":"darragh-king","email":"darraghking@gmail.com"},"repository":{"url":"git+https://github.com/yourusername/react-firebase-phone-auth.git","type":"git"},"_npmVersion":"11.6.2","description":"Complete, ready-to-use Firebase phone authentication solution for React apps with minimal setup","directories":{},"_nodeVersion":"24.11.1","dependencies":{"libphonenumber-js":"^1.10.51"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","rollup":"^4.6.1","postcss":"^8.4.31","@babel/core":"^7.23.0","@babel/preset-env":"^7.23.0","@babel/preset-react":"^7.22.0","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-terser":"^0.4.4","rollup-plugin-postcss":"^4.0.2","@testing-library/react":"^14.0.0","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-node-resolve":"^15.2.3","rollup-plugin-peer-deps-external":"^2.2.4"},"peerDependencies":{"react":"^16.8.0 || ^17.0.0 || ^18.0.0","firebase":"^9.0.0 || ^10.0.0","react-dom":"^16.8.0 || ^17.0.0 || ^18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react-firebase-phone-auth_1.0.0_1766852917936_0.28395208533264205","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@darragh-king/react-firebase-phone-auth","version":"1.0.1","keywords":["react","firebase","phone-auth","authentication","phone-number","otp","sms","verification","firebase-auth","react-component","auth-provider"],"author":"","license":"MIT","_id":"@darragh-king/react-firebase-phone-auth@1.0.1","maintainers":[{"name":"darragh-king","email":"darraghking@gmail.com"}],"homepage":"https://github.com/yourusername/react-firebase-phone-auth#readme","bugs":{"url":"https://github.com/yourusername/react-firebase-phone-auth/issues"},"dist":{"shasum":"d356b967d5c6c605f3951168bbf17fbd8320c69d","tarball":"https://registry.npmjs.org/@darragh-king/react-firebase-phone-auth/-/react-firebase-phone-auth-1.0.1.tgz","fileCount":7,"integrity":"sha512-mrXkQtLwCJtZRhHsICy9CYQov7J4iTROd7W4+1lc2i1+yWYKIP6ANDT+URDeg5/fcIJU8kU9QFdpdo3byPYgqg==","signatures":[{"sig":"MEUCIGPIAXukXljUY5z6rnHh787Wc4zFB9MsUrY3Q2FhGSyDAiEAlljwro8jvVnLxbJIYnvB8riNS8QXbGdosx29Zu6CRZI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1052434},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.esm.js","scripts":{"dev":"rollup -c -w","test":"jest","build":"rollup -c","prepublishOnly":"npm run build"},"_npmUser":{"name":"darragh-king","email":"darraghking@gmail.com"},"repository":{"url":"git+https://github.com/yourusername/react-firebase-phone-auth.git","type":"git"},"_npmVersion":"11.6.2","description":"Complete, ready-to-use Firebase phone authentication solution for React apps with minimal setup","directories":{},"_nodeVersion":"24.11.1","dependencies":{"libphonenumber-js":"^1.10.51"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","rollup":"^4.6.1","postcss":"^8.4.31","@babel/core":"^7.23.0","@babel/preset-env":"^7.23.0","@babel/preset-react":"^7.22.0","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-terser":"^0.4.4","rollup-plugin-postcss":"^4.0.2","@testing-library/react":"^14.0.0","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-node-resolve":"^15.2.3","rollup-plugin-peer-deps-external":"^2.2.4"},"peerDependencies":{"react":"^16.8.0 || ^17.0.0 || ^18.0.0","firebase":"^9.0.0 || ^10.0.0","react-dom":"^16.8.0 || ^17.0.0 || ^18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react-firebase-phone-auth_1.0.1_1766853055256_0.8825821386145296","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@darragh-king/react-firebase-phone-auth","version":"2.0.0","publishConfig":{"access":"public"},"description":"Complete, ready-to-use Firebase phone authentication solution for React apps with minimal setup","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","scripts":{"build":"rollup -c","dev":"rollup -c -w","prepublishOnly":"npm run build","test":"jest","update":"npm run update:patch","update:patch":"npm version patch && npm publish","update:minor":"npm version minor && npm publish","update:major":"npm version major && npm publish","publish:login":"npm login && npm publish","version:check":"npm version"},"keywords":["react","firebase","phone-auth","authentication","phone-number","otp","sms","verification","firebase-auth","react-component","auth-provider"],"author":"","license":"MIT","repository":{"type":"git","url":"git+https://github.com/yourusername/react-firebase-phone-auth.git"},"bugs":{"url":"https://github.com/yourusername/react-firebase-phone-auth/issues"},"homepage":"https://github.com/yourusername/react-firebase-phone-auth#readme","peerDependencies":{"react":"^16.8.0 || ^17.0.0 || ^18.0.0","react-dom":"^16.8.0 || ^17.0.0 || ^18.0.0","firebase":"^9.0.0 || ^10.0.0"},"devDependencies":{"@babel/core":"^7.23.0","@babel/preset-env":"^7.23.0","@babel/preset-react":"^7.22.0","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@testing-library/react":"^14.0.0","jest":"^29.7.0","postcss":"^8.4.31","rollup":"^4.6.1","rollup-plugin-peer-deps-external":"^2.2.4","rollup-plugin-postcss":"^4.0.2"},"dependencies":{"libphonenumber-js":"^1.10.51"},"gitHead":"40a49fc3103c49d7d94d65f8960de5a68cf7a094","_id":"@darragh-king/react-firebase-phone-auth@2.0.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-FOWtRBrJ2JAEqgjhZJD4aUvuxbLbmZ455xZGQOVdNuZnaolPn7FnyKpSIfUkUV4ojEft4Vak745HLbuGgHxVxg==","shasum":"1a5b4d0a910e1d31c1cea84482204f35654ee2d3","tarball":"https://registry.npmjs.org/@darragh-king/react-firebase-phone-auth/-/react-firebase-phone-auth-2.0.0.tgz","fileCount":7,"unpackedSize":1053116,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC/wAIeYCnRNlgiVyx97HSB+rYyvqK3iwOZbl/lJ5uJ2AIhAN+ZKPd3JpYkn8nDbnjixAFftwHudojkbSFtIrObr1bK"}]},"_npmUser":{"name":"darragh-king","email":"darraghking@gmail.com"},"directories":{},"maintainers":[{"name":"darragh-king","email":"darraghking@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-firebase-phone-auth_2.0.0_1766866281321_0.9549756885412559"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-27T16:28:37.870Z","modified":"2025-12-27T20:11:21.668Z","1.0.0":"2025-12-27T16:28:38.152Z","1.0.1":"2025-12-27T16:30:55.475Z","2.0.0":"2025-12-27T20:11:21.459Z"},"bugs":{"url":"https://github.com/yourusername/react-firebase-phone-auth/issues"},"license":"MIT","homepage":"https://github.com/yourusername/react-firebase-phone-auth#readme","keywords":["react","firebase","phone-auth","authentication","phone-number","otp","sms","verification","firebase-auth","react-component","auth-provider"],"repository":{"type":"git","url":"git+https://github.com/yourusername/react-firebase-phone-auth.git"},"description":"Complete, ready-to-use Firebase phone authentication solution for React apps with minimal setup","maintainers":[{"name":"darragh-king","email":"darraghking@gmail.com"}],"readme":"# React Firebase Phone Auth\n\nA complete, ready-to-use Firebase phone authentication solution for React apps with minimal setup required.\n\n## Features\n\n- 🔥 **Firebase Integration** - Seamless Firebase Auth integration\n- 📱 **Complete UI** - Beautiful, pre-built phone auth form\n- 🌍 **Regional Support** - Support for Ireland, UK, US, and all European countries\n- 🎨 **Customizable** - Easy styling with CSS classes and inline styles\n- 🌙 **Dark Mode** - Built-in dark mode support\n- ♿ **Accessible** - WCAG compliant and keyboard navigable\n- 🔒 **Secure** - Automatic invisible reCAPTCHA handling, rate limiting, and error handling\n- 📦 **Lightweight** - Small bundle size with tree-shaking support\n- 💪 **TypeScript** - Full TypeScript support with type definitions\n- 🎣 **Flexible** - Use pre-built components or custom UI with hooks\n\n## Installation\n\n```bash\nnpm install react-firebase-phone-auth firebase\n```\n\nor\n\n```bash\nyarn add react-firebase-phone-auth firebase\n```\n\n## Quick Start\n\n```jsx\nimport { PhoneAuthProvider, PhoneAuthForm } from 'react-firebase-phone-auth';\nimport 'react-firebase-phone-auth/dist/styles.css';\n\nconst firebaseConfig = {\n  apiKey: process.env.REACT_APP_FIREBASE_API_KEY,\n  authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN,\n  projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID,\n};\n\nfunction App() {\n  return (\n    <PhoneAuthProvider config={firebaseConfig}>\n      <PhoneAuthForm\n        onSuccess={(user) => console.log('Authenticated!', user)}\n        onError={(error) => console.error(error)}\n      />\n    </PhoneAuthProvider>\n  );\n}\n\nexport default App;\n```\n\n**Note:** Firebase Phone Auth requires reCAPTCHA. Make sure to:\n1. Enable Phone authentication in Firebase Console\n2. Add your domain to authorized domains in Firebase Console\n3. See [Setup Guide](docs/SETUP.md) and [reCAPTCHA Guide](docs/RECAPTCHA.md) for details\n\n## Documentation\n\n- **[Setup Guide](docs/SETUP.md)** - Complete Firebase setup instructions\n- **[reCAPTCHA Guide](docs/RECAPTCHA.md)** - Everything about reCAPTCHA configuration and troubleshooting\n- **[Usage Guide](docs/USAGE.md)** - Detailed usage examples and patterns\n- **[API Reference](docs/API.md)** - Complete API documentation\n- **[Styling Guide](docs/STYLING.md)** - Customization and theming\n- **[Publishing Guide](docs/PUBLISHING.md)** - How to publish to npm\n- **[Examples](docs/EXAMPLES.md)** - Real-world implementation examples\n\n## Components\n\n### PhoneAuthProvider\n\nContext provider that wraps your app and initializes Firebase.\n\n```jsx\n<PhoneAuthProvider config={firebaseConfig}>\n  {/* Your app */}\n</PhoneAuthProvider>\n```\n\n### PhoneAuthForm\n\nComplete phone authentication form with built-in UI.\n\n```jsx\n<PhoneAuthForm\n  onSuccess={(user) => console.log('Success!', user)}\n  onError={(error) => console.error(error)}\n  onCodeSent={(phoneNumber) => console.log('Code sent to', phoneNumber)}\n  defaultCountry=\"US\"\n  className=\"custom-class\"\n/>\n```\n\n### usePhoneAuth Hook\n\nFor building custom UI:\n\n```jsx\nimport { usePhoneAuth } from 'react-firebase-phone-auth';\n\nfunction CustomAuthForm() {\n  const { sendCode, verifyCode, user, loading, error, signOut } = usePhoneAuth();\n\n  // Build your custom UI\n  return (\n    <div>\n      {/* Your custom form */}\n    </div>\n  );\n}\n```\n\n## Props\n\n### PhoneAuthProvider\n\n| Prop | Type | Required | Description |\n|------|------|----------|-------------|\n| config | FirebaseConfig | Yes | Firebase configuration object |\n| children | ReactNode | Yes | Child components |\n\n### PhoneAuthForm\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| onSuccess | (user: User) => void | - | Callback when authentication succeeds |\n| onError | (error: Error) => void | - | Callback when an error occurs |\n| onCodeSent | (phoneNumber: string) => void | - | Callback when verification code is sent |\n| className | string | '' | Additional CSS class names |\n| style | CSSProperties | {} | Inline styles |\n| defaultCountry | string | 'IE' | Default country code (IE, GB, US, or any EU country) |\n| autoFocus | boolean | true | Auto focus on phone input |\n\n### usePhoneAuth Return Value\n\n| Property | Type | Description |\n|----------|------|-------------|\n| user | User \\| null | Current authenticated user |\n| loading | boolean | Loading state |\n| error | Error \\| null | Current error |\n| sendCode | (phoneNumber: string) => Promise | Send verification code |\n| verifyCode | (code: string) => Promise | Verify code and sign in |\n| signOut | () => Promise | Sign out current user |\n| clearError | () => void | Clear error state |\n\n## Features\n\n### Automatic Phone Number Formatting\n\nPhone numbers are automatically formatted to E.164 format required by Firebase.\n\n### Country Code Selector\n\nBuilt-in searchable country selector with support for Ireland, United Kingdom, United States, and all European countries (30+ countries total).\n\n### Resend Code\n\nAutomatic countdown timer (60 seconds) before allowing code resend.\n\n### Error Handling\n\nUser-friendly error messages for all Firebase error codes:\n- Invalid phone number\n- Too many requests\n- Invalid verification code\n- Network errors\n- Firebase quota exceeded\n\n### Dark Mode\n\nAutomatic dark mode support based on user's system preferences.\n\n## Browser Support\n\n- Chrome (latest)\n- Firefox (latest)\n- Safari (latest)\n- Edge (latest)\n- Mobile browsers (iOS Safari, Chrome Mobile)\n\n## Requirements\n\n- React 16.8+ (Hooks support)\n- Firebase 9.0+\n- Modern browser with ES6 support\n\n## License\n\nMIT\n\n## Contributing\n\nContributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details.\n\n## Support\n\n- [GitHub Issues](https://github.com/yourusername/react-firebase-phone-auth/issues)\n- [Documentation](docs/)\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for version history.\n","readmeFilename":"README.md"}