{"_id":"@alfredo-ai/leads-widget","_rev":"6-5332bd024346df906ca4d9b42b121daf","name":"@alfredo-ai/leads-widget","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.0":{"name":"@alfredo-ai/leads-widget","version":"1.0.0","keywords":["leads","widget","react","alfredo","real-estate"],"author":{"name":"Alfredo"},"license":"MIT","_id":"@alfredo-ai/leads-widget@1.0.0","maintainers":[{"name":"alfredo-ai","email":"geral@alfredo.pt"}],"homepage":"https://github.com/alfredo/alfredo-leads-widget#readme","bugs":{"url":"https://github.com/alfredo/alfredo-leads-widget/issues"},"dist":{"shasum":"b1f402f13fadc7bbfdca8f493bc534336b810f30","tarball":"https://registry.npmjs.org/@alfredo-ai/leads-widget/-/leads-widget-1.0.0.tgz","fileCount":7,"integrity":"sha512-+5nuxE3C7vdk43GWFebTO/czU54KXNT0M1V6rxtfv4hKxPxo7FTFtBKs49AD1FHY3ZmTdPwx5yNv9oZ1Vitrig==","signatures":[{"sig":"MEUCIQD7Cr01h/9nmheCzZR/N1WJIh/lxxF7RxiPyI0MRRQRqAIgd6yv37R+qGm/C/5ZvaywYNAhJD9Jo2+fw7VOdITXTRY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4770968},"main":"./dist/widget.umd.cjs","type":"module","module":"./dist/widget.js","exports":{".":{"import":"./dist/widget.js","require":"./dist/widget.umd.cjs"},"./style.css":"./dist/style.css"},"gitHead":"34dcc3d360e1beda5353dd856fa3d9da317d7fd0","scripts":{"dev":"vite","build":"vite build","preview":"vite preview","prepublishOnly":"npm run build"},"_npmUser":{"name":"alfredo-ai","email":"geral@alfredo.pt"},"repository":{"url":"git+https://github.com/alfredo/alfredo-leads-widget.git","type":"git"},"_npmVersion":"9.6.4","description":"Embeddable leads widget with optional SMS validation for Alfredo integration","directories":{},"_nodeVersion":"20.0.0","dependencies":{"axios":"^1.5.0","react":"^18.2.0","react-dom":"^18.2.0","classnames":"^2.3.2","react-redux":"^8.1.2","@mui/material":"^5.14.10","@emotion/react":"^11.11.1","@emotion/styled":"^11.11.0","@reduxjs/toolkit":"^1.9.5","libphonenumber-js":"^1.10.44","@fontsource/roboto":"^5.0.8","@mui/icons-material":"^5.14.9","react-number-format":"^5.3.1","autosuggest-highlight":"^3.3.4","material-ui-phone-number-2":"^1.3.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.4.1","express":"^4.18.2","postcss":"^8.4.29","tailwindcss":"^3.3.3","@types/react":"^18.2.15","autoprefixer":"^10.4.15","@types/react-dom":"^18.2.7","@vitejs/plugin-react":"^4.3.4"},"_npmOperationalInternal":{"tmp":"tmp/leads-widget_1.0.0_1770762827578_0.6660443889452932","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@alfredo-ai/leads-widget","version":"1.0.1","keywords":["leads","widget","react","alfredo","real-estate"],"author":{"name":"Alfredo"},"license":"MIT","_id":"@alfredo-ai/leads-widget@1.0.1","maintainers":[{"name":"alfredo-ai","email":"geral@alfredo.pt"}],"homepage":"https://github.com/alfredo/alfredo-leads-widget#readme","bugs":{"url":"https://github.com/alfredo/alfredo-leads-widget/issues"},"dist":{"shasum":"fd49f2a634f58f11f25799bfec7061c1c23b4f9d","tarball":"https://registry.npmjs.org/@alfredo-ai/leads-widget/-/leads-widget-1.0.1.tgz","fileCount":7,"integrity":"sha512-H7i8XbfSy/z//M+7Y1hoSZeyk08mhhfgHTVOh89RJnpqt4qyWl1mCjPNh0yOseJNca2dF8QvbdHKBPjZGuHAEw==","signatures":[{"sig":"MEUCIEKnCwlaT3Xn9XRx0VneQrUbByMvlQkA/oRNO4EIUKiQAiEAtdk+v8j5KTJG+9S3rd7MycmIEWuyEgVb2wuY0IZbSsw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4770881},"main":"./dist/widget.umd.cjs","type":"module","module":"./dist/widget.js","exports":{".":{"import":"./dist/widget.js","require":"./dist/widget.umd.cjs"},"./style.css":"./dist/style.css"},"gitHead":"34dcc3d360e1beda5353dd856fa3d9da317d7fd0","scripts":{"dev":"vite","build":"vite build","preview":"vite preview","prepublishOnly":"npm run build"},"_npmUser":{"name":"alfredo-ai","email":"geral@alfredo.pt"},"repository":{"url":"git+https://github.com/alfredo/alfredo-leads-widget.git","type":"git"},"_npmVersion":"9.6.4","description":"Embeddable leads widget with optional SMS validation for Alfredo integration","directories":{},"_nodeVersion":"20.0.0","dependencies":{"axios":"^1.5.0","react":"^18.2.0","react-dom":"^18.2.0","classnames":"^2.3.2","react-redux":"^8.1.2","@mui/material":"^5.14.10","@emotion/react":"^11.11.1","@emotion/styled":"^11.11.0","@reduxjs/toolkit":"^1.9.5","libphonenumber-js":"^1.10.44","@fontsource/roboto":"^5.0.8","@mui/icons-material":"^5.14.9","react-number-format":"^5.3.1","autosuggest-highlight":"^3.3.4","material-ui-phone-number-2":"^1.3.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.4.1","express":"^4.18.2","postcss":"^8.4.29","tailwindcss":"^3.3.3","@types/react":"^18.2.15","autoprefixer":"^10.4.15","@types/react-dom":"^18.2.7","@vitejs/plugin-react":"^4.3.4"},"_npmOperationalInternal":{"tmp":"tmp/leads-widget_1.0.1_1770762921553_0.3157214160581028","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@alfredo-ai/leads-widget","version":"1.0.2","keywords":["leads","widget","react","alfredo","real-estate"],"author":{"name":"Alfredo"},"license":"MIT","_id":"@alfredo-ai/leads-widget@1.0.2","maintainers":[{"name":"alfredo-ai","email":"geral@alfredo.pt"}],"homepage":"https://github.com/alfredo/alfredo-leads-widget#readme","bugs":{"url":"https://github.com/alfredo/alfredo-leads-widget/issues"},"dist":{"shasum":"7d800a258c72f0c3635e3330eca8e1c2ff73cbe6","tarball":"https://registry.npmjs.org/@alfredo-ai/leads-widget/-/leads-widget-1.0.2.tgz","fileCount":7,"integrity":"sha512-msm9o9jWaJNQCKOmjepvQOWULSzqw24sZGNpC/cbyN6aU2OH3RL9gQu3nTaW7GDLIHgQf4VpN0PpOEo6KlmfrQ==","signatures":[{"sig":"MEUCIEZDrSbuph56hrnI/fwRiEFkyCq5vU0ujfu7eBkentq5AiEA+CcZnCfm0QsWLQCa+N8rvLrN7GsmU967kVZsxxxySGk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4770878},"main":"./dist/widget.umd.cjs","type":"module","module":"./dist/widget.js","exports":{".":{"import":"./dist/widget.js","require":"./dist/widget.umd.cjs"},"./style.css":"./dist/style.css"},"gitHead":"34dcc3d360e1beda5353dd856fa3d9da317d7fd0","scripts":{"dev":"vite","build":"vite build","deploy":"npm publish --access public","preview":"vite preview","prepublishOnly":"npm run build"},"_npmUser":{"name":"alfredo-ai","email":"geral@alfredo.pt"},"repository":{"url":"git+https://github.com/alfredo/alfredo-leads-widget.git","type":"git"},"_npmVersion":"9.6.4","description":"Embeddable leads widget with optional SMS validation for Alfredo integration","directories":{},"_nodeVersion":"20.0.0","dependencies":{"axios":"^1.5.0","react":"^18.2.0","react-dom":"^18.2.0","classnames":"^2.3.2","react-redux":"^8.1.2","@mui/material":"^5.14.10","@emotion/react":"^11.11.1","@emotion/styled":"^11.11.0","@reduxjs/toolkit":"^1.9.5","libphonenumber-js":"^1.10.44","@fontsource/roboto":"^5.0.8","@mui/icons-material":"^5.14.9","react-number-format":"^5.3.1","autosuggest-highlight":"^3.3.4","material-ui-phone-number-2":"^1.3.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.4.1","express":"^4.18.2","postcss":"^8.4.29","tailwindcss":"^3.3.3","@types/react":"^18.2.15","autoprefixer":"^10.4.15","@types/react-dom":"^18.2.7","@vitejs/plugin-react":"^4.3.4"},"_npmOperationalInternal":{"tmp":"tmp/leads-widget_1.0.2_1770767148280_0.07370927463823973","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@alfredo-ai/leads-widget","version":"1.0.3","keywords":["leads","widget","react","alfredo","real-estate"],"author":{"name":"Alfredo"},"license":"MIT","_id":"@alfredo-ai/leads-widget@1.0.3","maintainers":[{"name":"alfredo-ai","email":"geral@alfredo.pt"}],"homepage":"https://github.com/alfredo/alfredo-leads-widget#readme","bugs":{"url":"https://github.com/alfredo/alfredo-leads-widget/issues"},"dist":{"shasum":"62588fe0b2560ffb4ff31b25d30f8705dafa1105","tarball":"https://registry.npmjs.org/@alfredo-ai/leads-widget/-/leads-widget-1.0.3.tgz","fileCount":7,"integrity":"sha512-XstedFIVAsGOnXyc5PjhE6+f2lN3OPKTnh7Vals6w4noz45VHI1neVqQIS9xM6J0wK0+YbRzkbZI0erY6n9nag==","signatures":[{"sig":"MEUCIQDnwWYKblcmxsXabRQmWuJOurEU3bB+kETd0xoDk/0LrwIgXjnm8lYAxU8XtOJ3avhzKCiDmLK+tVHvPS2IbeiIM/I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4770969},"main":"./dist/widget.umd.cjs","type":"module","module":"./dist/widget.js","exports":{".":{"import":"./dist/widget.js","require":"./dist/widget.umd.cjs"},"./style.css":"./dist/style.css"},"gitHead":"5375e2a8caade25100b448ad3f777a08650ef0d2","scripts":{"dev":"vite","build":"vite build","deploy":"npm publish --access public","preview":"vite preview","prepublishOnly":"npm run build"},"_npmUser":{"name":"alfredo-ai","email":"geral@alfredo.pt"},"repository":{"url":"git+https://github.com/alfredo/alfredo-leads-widget.git","type":"git"},"_npmVersion":"9.6.4","description":"Embeddable leads widget with optional SMS validation for Alfredo integration","directories":{},"_nodeVersion":"20.0.0","dependencies":{"axios":"^1.5.0","react":"^18.2.0","react-dom":"^18.2.0","classnames":"^2.3.2","react-redux":"^8.1.2","@mui/material":"^5.14.10","@emotion/react":"^11.11.1","@emotion/styled":"^11.11.0","@reduxjs/toolkit":"^1.9.5","libphonenumber-js":"^1.10.44","@fontsource/roboto":"^5.0.8","@mui/icons-material":"^5.14.9","react-number-format":"^5.3.1","autosuggest-highlight":"^3.3.4","material-ui-phone-number-2":"^1.3.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.4.1","express":"^4.18.2","postcss":"^8.4.29","tailwindcss":"^3.3.3","@types/react":"^18.2.15","autoprefixer":"^10.4.15","@types/react-dom":"^18.2.7","@vitejs/plugin-react":"^4.3.4"},"_npmOperationalInternal":{"tmp":"tmp/leads-widget_1.0.3_1770803461601_0.1829932431562078","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@alfredo-ai/leads-widget","version":"1.0.4","keywords":["leads","widget","react","alfredo","real-estate"],"author":{"name":"Alfredo"},"license":"MIT","_id":"@alfredo-ai/leads-widget@1.0.4","maintainers":[{"name":"alfredo-ai","email":"geral@alfredo.pt"}],"homepage":"https://github.com/alfredo/alfredo-leads-widget#readme","bugs":{"url":"https://github.com/alfredo/alfredo-leads-widget/issues"},"dist":{"shasum":"9c5df9665c10c3be94e8428f97b476f34756d17d","tarball":"https://registry.npmjs.org/@alfredo-ai/leads-widget/-/leads-widget-1.0.4.tgz","fileCount":7,"integrity":"sha512-zo+s9jen/xZGzft2NEMKKJm7/6Hh5XANIPmF0QSfkbGFizEBbJnL2ULimH33dFMbVJoxsBlY5/pKIDIrw7XXnA==","signatures":[{"sig":"MEUCIQD8LpZ6AwvxESiqosECjgVFDOvsE38z9Q9uDtfOE3TuGwIgGKVAOZxx4umxAq8eOfXCZogqrdn2AwyO9PXBH3KyDtY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4772058},"main":"./dist/widget.umd.cjs","type":"module","module":"./dist/widget.js","exports":{".":{"import":"./dist/widget.js","require":"./dist/widget.umd.cjs"},"./style.css":"./dist/style.css"},"gitHead":"107f42360355382fa6391777aa61d151e90075d5","scripts":{"dev":"vite","build":"vite build","deploy":"npm publish --access public","preview":"vite preview","prepublishOnly":"npm run build"},"_npmUser":{"name":"alfredo-ai","email":"geral@alfredo.pt"},"repository":{"url":"git+https://github.com/alfredo/alfredo-leads-widget.git","type":"git"},"_npmVersion":"9.6.4","description":"Embeddable leads widget with optional SMS validation for Alfredo integration","directories":{},"_nodeVersion":"20.0.0","dependencies":{"axios":"^1.5.0","react":"^18.2.0","react-dom":"^18.2.0","classnames":"^2.3.2","react-redux":"^8.1.2","@mui/material":"^5.14.10","@emotion/react":"^11.11.1","@emotion/styled":"^11.11.0","@reduxjs/toolkit":"^1.9.5","libphonenumber-js":"^1.10.44","@fontsource/roboto":"^5.0.8","@mui/icons-material":"^5.14.9","react-number-format":"^5.3.1","autosuggest-highlight":"^3.3.4","material-ui-phone-number-2":"^1.3.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.4.1","express":"^4.18.2","postcss":"^8.4.29","tailwindcss":"^3.3.3","@types/react":"^18.2.15","autoprefixer":"^10.4.15","@types/react-dom":"^18.2.7","@vitejs/plugin-react":"^4.3.4"},"_npmOperationalInternal":{"tmp":"tmp/leads-widget_1.0.4_1770804254150_0.34438747422197924","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@alfredo-ai/leads-widget","version":"1.0.5","description":"Embeddable leads widget with optional SMS validation for Alfredo integration","keywords":["leads","widget","react","alfredo","real-estate"],"author":{"name":"Alfredo"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/alfredo/alfredo-leads-widget.git"},"homepage":"https://github.com/alfredo/alfredo-leads-widget#readme","bugs":{"url":"https://github.com/alfredo/alfredo-leads-widget/issues"},"type":"module","main":"./dist/widget.umd.cjs","module":"./dist/widget.js","exports":{".":{"import":"./dist/widget.js","require":"./dist/widget.umd.cjs"},"./style.css":"./dist/style.css"},"scripts":{"dev":"vite","build":"vite build","preview":"vite preview","prepublishOnly":"npm run build","deploy":"npm publish --access public"},"dependencies":{"@emotion/react":"^11.11.1","@emotion/styled":"^11.11.0","@fontsource/roboto":"^5.0.8","@mui/icons-material":"^5.14.9","@mui/material":"^5.14.10","@reduxjs/toolkit":"^1.9.5","autosuggest-highlight":"^3.3.4","axios":"^1.5.0","classnames":"^2.3.2","libphonenumber-js":"^1.10.44","material-ui-phone-number-2":"^1.3.0","react":"^18.2.0","react-dom":"^18.2.0","react-number-format":"^5.3.1","react-redux":"^8.1.2"},"devDependencies":{"@types/react":"^18.2.15","@types/react-dom":"^18.2.7","@vitejs/plugin-react":"^4.3.4","autoprefixer":"^10.4.15","express":"^4.18.2","postcss":"^8.4.29","tailwindcss":"^3.3.3","vite":"^6.4.1"},"_id":"@alfredo-ai/leads-widget@1.0.5","gitHead":"ce783feefc813580d6d5b1aef628c94d0e81cc09","_nodeVersion":"24.0.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-rfyUbn/vmNLwmJPASqAm6zYPTMCsHmh6xNTr8BxI0y3T5fRMHVRjw7NHUvcCWg5G0Fn3WigJfpoa//IV4L5Qtg==","shasum":"8591a39f59079262b47fb4752118398bc7f2174c","tarball":"https://registry.npmjs.org/@alfredo-ai/leads-widget/-/leads-widget-1.0.5.tgz","fileCount":7,"unpackedSize":4847778,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFGLFlVdhrvrjee9tjesNgA4kE3UnjA5QDZW+PJO6gGuAiEA2XpSHuKeQeozz1AFyD6KS/Xoy2S4hVUmyuA0iwQfzhY="}]},"_npmUser":{"name":"alfredo-ai","email":"geral@alfredo.pt"},"directories":{},"maintainers":[{"name":"alfredo-ai","email":"geral@alfredo.pt"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/leads-widget_1.0.5_1787846790337_0.5973277862880337"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-10T22:33:47.480Z","modified":"2026-08-27T16:06:30.696Z","1.0.0":"2026-02-10T22:33:47.777Z","1.0.1":"2026-02-10T22:35:21.863Z","1.0.2":"2026-02-10T23:45:48.516Z","1.0.3":"2026-02-11T09:51:01.862Z","1.0.4":"2026-02-11T10:04:14.395Z","1.0.5":"2026-08-27T16:06:30.512Z"},"bugs":{"url":"https://github.com/alfredo/alfredo-leads-widget/issues"},"author":{"name":"Alfredo"},"license":"MIT","homepage":"https://github.com/alfredo/alfredo-leads-widget#readme","keywords":["leads","widget","react","alfredo","real-estate"],"repository":{"type":"git","url":"git+https://github.com/alfredo/alfredo-leads-widget.git"},"description":"Embeddable leads widget with optional SMS validation for Alfredo integration","maintainers":[{"name":"alfredo-ai","email":"geral@alfredo.pt"}],"readme":"# @alfredo-ai/leads-widget\n\nEmbeddable leads widget with optional SMS validation, designed for Alfredo AI integration. Built with React, Material UI, Redux, and TailwindCSS.\n\n## Features\n\n- Multi-step lead form (location, characteristics, personal data, optional SMS validation)\n- Multi-language support (Portuguese, English, Spanish)\n- Google Maps integration for location selection\n- Price interval / estimation display\n- Optional SMS verification flow\n- Theming via `primaryColor` and `backgroundColor`\n- Lifecycle callbacks: `onSuccess`, `onError`, `onStepChange`\n\n## Installation\n\n### Via npm (not tested)\n\n```bash\nnpm install @alfredo-ai/leads-widget\n```\n\n### Via script tag (CDN)\n\nNo install required. Load the UMD bundle directly (see [Script tag usage](#script-tag-umd) below).\n\n---\n\n## Usage\n\n### Script tag (UMD)\n\n1. Add a container element where the widget should render:\n\n```html\n<div id=\"leads-widget-root\"></div>\n```\n\n2. Load the widget script and styles:\n\n```html\n<script src=\"https://unpkg.com/@alfredo-ai/leads-widget/dist/widget.umd.cjs\"></script>\n<link rel=\"stylesheet\" href=\"https://unpkg.com/@alfredo-ai/leads-widget/dist/style.css\" />\n```\n\n3. Initialize the widget:\n\n```html\n<script>\n  window.initLeadsWidget({\n    token: \"YOUR_ALFREDO_LEADS_TOKEN\",\n    container: \"leads-widget-root\",\n    origin: \"pt\",\n  });\n</script>\n```\n\n### NPM / ESM (React or any bundler)\n\nImport the package so that `initLeadsWidget` is attached to `window`, then call it once the container element is in the DOM:\n\n```js\nimport \"@alfredo-ai/leads-widget\";\nimport \"@alfredo-ai/leads-widget/style.css\";\n\nwindow.initLeadsWidget({\n  token: \"YOUR_ALFREDO_LEADS_TOKEN\",\n  container: \"leads-widget-root\",\n  origin: \"pt\",\n});\n```\n\nExample in a React component:\n\n```jsx\nimport { useEffect } from \"react\";\nimport \"@alfredo-ai/leads-widget\";\nimport \"@alfredo-ai/leads-widget/style.css\";\n\nfunction LeadsWidget() {\n  useEffect(() => {\n    window.initLeadsWidget({\n      token: \"YOUR_ALFREDO_LEADS_TOKEN\",\n      container: \"leads-widget-root\",\n      origin: \"pt\",\n    });\n  }, []);\n\n  return <div id=\"leads-widget-root\" />;\n}\n```\n\n---\n\n## Configuration options\n\n| Option            | Type    | Default     | Description                                       |\n| ----------------- | ------- | ----------- | ------------------------------------------------- |\n| `container`       | string  | `\"root\"`    | DOM id of the element where the widget mounts.    |\n| `origin`          | string  | `\"pt\"`      | Origin/locale key (`\"pt\"`, `\"es\"`).       |\n| `userID`          | string  | `null`      | Optional user identifier.                         |\n| `lang`            | string  | `null`      | Preferred language (`pt`, `en`, `es`).            |\n| `token`           | string  | -           | Alfredo leads API token.                          |\n| `showHeader`      | boolean | `true`      | Whether to show the widget header.                |\n| `primaryColor`    | string  | `\"#009de0\"` | Primary theme color (hex).                        |\n| `backgroundColor` | string  | `\"#f7f7f7\"` | Background color (hex).                           |\n| `onSuccess`       | function | `() => {}`  | Callback when lead is submitted successfully.     |\n| `onError`         | function | `() => {}`  | Callback when submission fails; receives the error.|\n| `onStepChange`    | function | `() => {}`  | Callback when user navigates steps; receives new step number.|\n\n---\n\n## Callbacks\n\n### `onSuccess`\n\nCalled when the lead is successfully submitted (either after the initial API submit or after SMS verification).\n\n```js\nwindow.initLeadsWidget({\n  token: \"YOUR_ALFREDO_LEADS_TOKEN\",\n  container: \"leads-widget-root\",\n  onSuccess: () => {\n    console.log(\"Lead submitted successfully\");\n    // e.g. redirect, show thank you, track analytics\n  },\n});\n```\n\n### `onError`\n\nCalled when lead submission or SMS validation fails. Receives the error object from the API.\n\n```js\nwindow.initLeadsWidget({\n  token: \"YOUR_ALFREDO_LEADS_TOKEN\",\n  container: \"leads-widget-root\",\n  onError: (error) => {\n    console.error(\"Lead submission failed\", error);\n    // error?.data?.detail may contain API error details\n  },\n});\n```\n\n### `onStepChange`\n\nCalled when the user navigates between form steps (forward or back). Receives the new step number (1-based).\n\n```js\nwindow.initLeadsWidget({\n  token: \"YOUR_ALFREDO_LEADS_TOKEN\",\n  container: \"leads-widget-root\",\n  onStepChange: (stepNumber) => {\n    console.log(\"User is on step\", stepNumber);\n    // e.g. track funnel analytics, update progress in parent UI\n  },\n});\n```\n\n---\n\n## License\n\nMIT. See [LICENSE](LICENSE) for details.\n","readmeFilename":"README.md"}