{"_id":"@digicroz/whatsapp-link","name":"@digicroz/whatsapp-link","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@digicroz/whatsapp-link","version":"1.0.0","description":"TypeScript utility for generating WhatsApp chat/share links with phone number normalization and message support.","keywords":["typescript","whatsapp","link","url","phone","libphonenumber-js","messaging","utility","wa.me","api.whatsapp.com","deep-link","chat","share"],"type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/digicroz/whatsapp-link.git"},"homepage":"https://github.com/digicroz/whatsapp-link#readme","bugs":{"url":"https://github.com/digicroz/whatsapp-link/issues"},"author":{"name":"Adarsh Hatkar","url":"https://github.com/AdarshHatkar"},"license":"MIT","engines":{"node":">=16.0.0"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","dev":"tsup --watch","clean":"npx rimraf dist","prepublishOnly":"npm run clean && npm run build","release:patch":"npm version patch","postversion":"git push && git push --tags && npm publish","link":"npm run build && npm link"},"devDependencies":{"tsup":"^8.5.0","typescript":"^5.4.0"},"dependencies":{"@digicroz/js-kit":"^1.0.11","libphonenumber-js":"^1.12.14"},"_id":"@digicroz/whatsapp-link@1.0.0","gitHead":"5acb262838e2d56da9d4c0ad277db0628a71058f","_nodeVersion":"22.16.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-MRms9QL0BKlGOjThPpSgLD0L1HM2eafZDpvdwSqVOTNm++sdx7LPDmaZCxhyOlvnzaV65Ajbu75b/XsXJxQlSA==","shasum":"a5566c3c8283d2fa7775daf697524ddc5bd7210a","tarball":"https://registry.npmjs.org/@digicroz/whatsapp-link/-/whatsapp-link-1.0.0.tgz","fileCount":14,"unpackedSize":21038,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCaIS9JDm7Bl42S1eG2mG43UW39AGZC5vxn3z3sTeZIugIhAI5tEH5eSk1nF6vJ7uiZT8BSOAbFZh0GEWAQMkNa7rRj"}]},"_npmUser":{"name":"adarshhatkar","email":"rajeadarsh15@gmail.com"},"directories":{},"maintainers":[{"name":"adarshhatkar","email":"rajeadarsh15@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/whatsapp-link_1.0.0_1771509939630_0.2694274469767943"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-19T14:05:39.550Z","1.0.0":"2026-02-19T14:05:39.771Z","modified":"2026-02-19T14:05:39.966Z"},"maintainers":[{"name":"adarshhatkar","email":"rajeadarsh15@gmail.com"}],"description":"TypeScript utility for generating WhatsApp chat/share links with phone number normalization and message support.","homepage":"https://github.com/digicroz/whatsapp-link#readme","keywords":["typescript","whatsapp","link","url","phone","libphonenumber-js","messaging","utility","wa.me","api.whatsapp.com","deep-link","chat","share"],"repository":{"type":"git","url":"git+https://github.com/digicroz/whatsapp-link.git"},"author":{"name":"Adarsh Hatkar","url":"https://github.com/AdarshHatkar"},"bugs":{"url":"https://github.com/digicroz/whatsapp-link/issues"},"license":"MIT","readme":"# WhatsApp Link Utility\r\n\r\n> **TypeScript utility for generating WhatsApp chat/share links with phone number normalization and message support.**\r\n\r\n[![npm version](https://badge.fury.io/js/@dxkit-org/whatsapp-link.svg)](https://www.npmjs.com/package/@dxkit-org/whatsapp-link)\r\n[![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg)](https://www.typescriptlang.org/)\r\n[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\r\n\r\nGenerate WhatsApp chat or share links with proper phone number formatting and optional pre-filled messages. Supports both `wa.me` and `api.whatsapp.com` links, as well as deep links for mobile apps.\r\n\r\n## Features\r\n\r\n- � **WhatsApp Link Generation** - Create links to start chats or share messages\r\n- 🌍 **Phone Number Normalization** - Uses `libphonenumber-js` for robust parsing\r\n- ✉️ **Message Support** - Pre-fill messages in the chat\r\n- � **wa.me / api.whatsapp.com / Deep Link** - Choose your preferred link type\r\n- 🌐 **TypeScript** - Full type safety and IDE support\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @dxkit-org/whatsapp-link\r\n```\r\n\r\n## Usage\r\n\r\n```typescript\r\nimport { buildWhatsAppLink } from \"@dxkit-org/whatsapp-link\"\r\n\r\n// Basic chat link\r\nconst url = buildWhatsAppLink({ number: \"+919999999999\" })\r\n// https://wa.me/919999999999\r\n\r\n// With message\r\nconst url2 = buildWhatsAppLink({ number: \"+919999999999\", message: \"Hello!\" })\r\n// https://wa.me/919999999999?text=Hello%21\r\n\r\n// Share-only (no number)\r\nconst url3 = buildWhatsAppLink({ message: \"Check this out!\" })\r\n// https://api.whatsapp.com/send?text=Check%20this%20out%21\r\n\r\n// Deep link (for mobile apps)\r\nconst url4 = buildWhatsAppLink({ number: \"+919999999999\", deepLink: true })\r\n// whatsapp://send?phone=919999999999\r\n\r\n// Use api.whatsapp.com instead of wa.me\r\nconst url5 = buildWhatsAppLink({ number: \"+919999999999\", preferWaMe: false })\r\n// https://api.whatsapp.com/send?phone=919999999999\r\n```\r\n\r\n## API\r\n\r\n### `buildWhatsAppLink(options)`\r\n\r\n#### Options\r\n\r\n| Name             | Type        | Description                                                          |\r\n| ---------------- | ----------- | -------------------------------------------------------------------- |\r\n| `number`         | string      | Phone number (international or local, optional for share-only links) |\r\n| `message`        | string      | Message to pre-fill (optional)                                       |\r\n| `preferWaMe`     | boolean     | Use `wa.me` (default: true). If false, uses `api.whatsapp.com`       |\r\n| `deepLink`       | boolean     | Use `whatsapp://` deep link (default: false)                         |\r\n| `defaultCountry` | CountryCode | Country code for parsing local numbers (default: \"IN\")               |\r\n\r\n#### Returns\r\n\r\n- `string` - The WhatsApp link URL\r\n\r\n#### Throws\r\n\r\n- Error if the phone number is invalid (when provided)\r\n\r\n## Development\r\n\r\n```bash\r\n# Install dependencies\r\nnpm install\r\n\r\n# Build the project\r\nnpm run build\r\n\r\n# Watch mode for development\r\nnpm run dev\r\n\r\n# Type checking\r\nnpm run type-check\r\n```\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md","_rev":"1-c8547a80d41706af0c0d599470ded082"}