{"_id":"@altbot/js","_rev":"1-9d0d71406c7500d45dfa7183ded2d7d0","name":"@altbot/js","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@altbot/js","version":"1.0.0","description":"Javascript library to display typebots on your website","type":"module","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"dev":"rollup --watch --config rollup.config.js","build":"rollup --config rollup.config.js","lint":"eslint --fix \"src/**/*.ts*\""},"license":"MIT","dependencies":{"@stripe/stripe-js":"1.52.1","@udecode/plate-common":"^21.0.0","solid-element":"1.7.0","solid-js":"1.7.4"},"devDependencies":{"@babel/preset-typescript":"7.21.5","@rollup/plugin-babel":"6.0.3","@rollup/plugin-node-resolve":"15.0.2","@rollup/plugin-terser":"0.4.1","@rollup/plugin-typescript":"11.1.0","@typebot.io/lib":"workspace:*","@typebot.io/schemas":"workspace:*","@typebot.io/tsconfig":"workspace:*","autoprefixer":"10.4.14","babel-preset-solid":"1.7.4","eslint":"8.39.0","eslint-config-custom":"workspace:*","eslint-plugin-solid":"0.12.1","postcss":"8.4.23","react":"18.2.0","rollup":"3.20.2","rollup-plugin-postcss":"4.0.2","rollup-plugin-typescript-paths":"1.4.0","tailwindcss":"3.3.2","typescript":"5.0.4"},"author":{"name":"asadul"},"repository":{"type":"git","url":"git+https://github.com/AltSolutions1/altbot.git"},"bugs":{"url":"https://github.com/AltSolutions1/altbot/issues"},"homepage":"https://github.com/AltSolutions1/altbot#readme","_id":"@altbot/js@1.0.0","gitHead":"a1dabb756c9d63d0ba910e218d4b3a958137d5a1","_nodeVersion":"20.10.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-kXl7OqVEBZuTxIyjBQn+sUXclxJuWF5ffQK8R05W8pHqrgAkpfP0pKVMPWTzC/3UO0WjzvPcv5pfzhDP0OMM1Q==","shasum":"5a3f606cb52ceb50ebab187d59fd231907cb7f1a","tarball":"https://registry.npmjs.org/@altbot/js/-/js-1.0.0.tgz","fileCount":252,"unpackedSize":316589,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFaR2KAPC/NCIzSfMlux6tA8jYYgE/fGoAPycN2WQ6w6AiBqx7QRoGMOLuGnYLGYtj4GuwYolZa4VYgyS1Bk0f8pnA=="}]},"_npmUser":{"name":"ai.sohag327","email":"ai.sohag327@gmail.com"},"directories":{},"maintainers":[{"name":"ai.sohag327","email":"ai.sohag327@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js_1.0.0_1708595475368_0.5353664484293406"},"_hasShrinkwrap":false},"1.0.1":{"name":"@altbot/js","version":"1.0.1","description":"Javascript library to display typebots on your website","type":"module","author":{"name":"asadul islam"},"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"dev":"rollup --watch --config rollup.config.js","build":"rollup --config rollup.config.js","lint":"eslint --fix \"src/**/*.ts*\""},"license":"MIT","dependencies":{"@stripe/stripe-js":"1.52.1","@udecode/plate-common":"^21.0.0","solid-element":"1.7.0","solid-js":"1.7.4"},"devDependencies":{"@babel/preset-typescript":"7.21.5","@rollup/plugin-babel":"6.0.3","@rollup/plugin-node-resolve":"15.0.2","@rollup/plugin-terser":"0.4.1","@rollup/plugin-typescript":"11.1.0","@typebot.io/lib":"workspace:*","@typebot.io/schemas":"workspace:*","@typebot.io/tsconfig":"workspace:*","autoprefixer":"10.4.14","babel-preset-solid":"1.7.4","eslint":"8.39.0","eslint-config-custom":"workspace:*","eslint-plugin-solid":"0.12.1","postcss":"8.4.23","react":"18.2.0","rollup":"3.20.2","rollup-plugin-postcss":"4.0.2","rollup-plugin-typescript-paths":"1.4.0","tailwindcss":"3.3.2","typescript":"5.0.4"},"repository":{"type":"git","url":"git+https://github.com/AltSolutions1/altbot.git"},"bugs":{"url":"https://github.com/AltSolutions1/altbot/issues"},"homepage":"https://github.com/AltSolutions1/altbot#readme","_id":"@altbot/js@1.0.1","gitHead":"a1dabb756c9d63d0ba910e218d4b3a958137d5a1","_nodeVersion":"20.10.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-voWezu4zaH7O1x2oQWrshcbKMmRbmE8aL16JElGFNLiL+LQmlk93M2iiATeXRCk+Y3fejqLOEngvcStYyjg/sQ==","shasum":"6215a0e8a1d24482bacf5ab8901c47f80eea4d35","tarball":"https://registry.npmjs.org/@altbot/js/-/js-1.0.1.tgz","fileCount":252,"unpackedSize":316226,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB6UQh4a6QSg1k3f7/UCYwpBcAm73V7y3QjvNDXZIb1YAiBTOcM7Vej40OdvwsSjwUgqz2S+hzY7p83xgjGXBIk31w=="}]},"_npmUser":{"name":"ai.sohag327","email":"ai.sohag327@gmail.com"},"directories":{},"maintainers":[{"name":"ai.sohag327","email":"ai.sohag327@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js_1.0.1_1708597524178_0.41609708856570493"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-22T09:51:15.292Z","1.0.0":"2024-02-22T09:51:15.575Z","modified":"2024-02-22T10:25:24.820Z","1.0.1":"2024-02-22T10:25:24.378Z"},"maintainers":[{"name":"ai.sohag327","email":"ai.sohag327@gmail.com"}],"description":"Javascript library to display typebots on your website","homepage":"https://github.com/AltSolutions1/altbot#readme","repository":{"type":"git","url":"git+https://github.com/AltSolutions1/altbot.git"},"author":{"name":"asadul islam"},"bugs":{"url":"https://github.com/AltSolutions1/altbot/issues"},"license":"MIT","readme":"## Installation\r\n\r\n### Using npm\r\n\r\nTo install, simply run:\r\n\r\n```bash\r\nnpm install @altbot/js\r\n```\r\n\r\n### Directly in your HTML\r\n\r\n```\r\n<script type=\"module\">\r\n  import Typebot from 'https://cdn.jsdelivr.net/npm/@altbot/js/dist/web.js'\r\n\r\n  Typebot.initStandard({\r\n    typebot: 'my-typebot',\r\n  })\r\n</script>\r\n\r\n<typebot-standard style=\"width: 100%; height: 600px; \"></typebot-standard>\r\n```\r\n\r\n## Standard\r\n\r\nYou can get the standard HTML and Javascript code by clicking on the \"HTML & Javascript\" button in the \"Share\" tab of your typebot.\r\n\r\nThere, you can change the container dimensions. Here is a code example:\r\n\r\n```html\r\n<script type=\"module\">\r\n  import Typebot from 'https://cdn.jsdelivr.net/npm/@altbot/js@1.0.0-/dist/web.js'\r\n\r\n  Typebot.initStandard({\r\n    typebot: 'my-typebot',\r\n  })\r\n</script>\r\n\r\n<typebot-standard style=\"width: 100%; height: 600px; \"></typebot-standard>\r\n```\r\n\r\nThis code is creating a container with a 100% width (will match parent width) and 600px height.\r\n\r\n## Popup\r\n\r\nYou can get the popup HTML and Javascript code by clicking on the \"HTML & Javascript\" button in the \"Share\" tab of your typebot.\r\n\r\nHere is an example:\r\n\r\n```html\r\n<script type=\"module\">\r\n  import Typebot from 'https://cdn.jsdelivr.net/npm/@altbot/js@1.0.0/dist/web.js'\r\n\r\n  Typebot.initPopup({\r\n    typebot: 'my-typebot',\r\n    apiHost: 'http://localhost:3001',\r\n    autoShowDelay: 3000,\r\n  })\r\n</script>\r\n```\r\n\r\nThis code will automatically trigger the popup window after 3 seconds.\r\n\r\n### Open or Close a popup\r\n\r\nYou can use these commands:\r\n\r\n```js\r\nTypebot.open()\r\n```\r\n\r\n```js\r\nTypebot.close()\r\n```\r\n\r\n```js\r\nTypebot.toggle()\r\n```\r\n\r\nYou can bind these commands on a button element, for example:\r\n\r\n```html\r\n<button onclick=\"Typebot.open()\">Contact us</button>\r\n```\r\n\r\n## Bubble\r\n\r\nYou can get the bubble HTML and Javascript code by clicking on the \"HTML & Javascript\" button in the \"Share\" tab of your typebot.\r\n\r\nHere is an example:\r\n\r\n```html\r\n<script type=\"module\">\r\n  import Typebot from 'https://cdn.jsdelivr.net/npm/@altbot/js@1.0.0/dist/web.js'\r\n\r\n  Typebot.initBubble({\r\n    typebot: 'my-typebot',\r\n    previewMessage: {\r\n      message: 'I have a question for you!',\r\n      autoShowDelay: 5000,\r\n      avatarUrl: 'https://avatars.githubusercontent.com/u/16015833?v=4',\r\n    },\r\n    theme: {\r\n      button: { backgroundColor: '#0042DA', iconColor: '#FFFFFF' },\r\n      previewMessage: { backgroundColor: '#ffffff', textColor: 'black' },\r\n      chatWindow: { backgroundColor: '#ffffff' },\r\n    },\r\n  })\r\n</script>\r\n```\r\n\r\nThis code will show the bubble and let a preview message appear after 5 seconds.\r\n\r\n### Open or close the preview message\r\n\r\nYou can use these commands:\r\n\r\n```js\r\nTypebot.showPreviewMessage()\r\n```\r\n\r\n```js\r\nTypebot.hidePreviewMessage()\r\n```\r\n\r\n### Open or close the typebot\r\n\r\nYou can use these commands:\r\n\r\n```js\r\nTypebot.open()\r\n```\r\n\r\n```js\r\nTypebot.close()\r\n```\r\n\r\n```js\r\nTypebot.toggle()\r\n```\r\n\r\nYou can bind these commands on a button element, for example:\r\n\r\n```html\r\n<button onclick=\"Typebot.open()\">Contact us</button>\r\n```\r\n\r\n## Additional configuration\r\n\r\nYou can prefill the bot variable values in your embed code by adding the `prefilledVariables` option. Here is an example:\r\n\r\n```js\r\nTypebot.initStandard({\r\n  typebot: 'my-typebot',\r\n  prefilledVariables: {\r\n    'Current URL': 'https://my-site/account',\r\n    'User name': 'John Doe',\r\n  },\r\n})\r\n```\r\n\r\nIt will prefill the `Current URL` variable with \"https://my-site/account\" and the `User name` variable with \"John Doe\". More info about variables: [here](/editor/variables).\r\n","readmeFilename":"README.md"}