{"_id":"@bot-flux/js","_rev":"2-d3e290add7d1ed0fa9e887a65ec0f904","name":"@bot-flux/js","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@bot-flux/js","version":"0.0.1","description":"Javascript library to display botflux bots 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.54.1","@udecode/plate-common":"^21.1.5","eventsource-parser":"^1.0.0","solid-element":"1.7.1","solid-js":"1.7.8"},"devDependencies":{"@babel/preset-typescript":"7.22.5","@rollup/plugin-babel":"6.0.3","@rollup/plugin-node-resolve":"15.1.0","@rollup/plugin-terser":"0.4.3","@rollup/plugin-typescript":"11.1.2","@typebot.io/lib":"workspace:*","@typebot.io/schemas":"workspace:*","@typebot.io/tsconfig":"workspace:*","autoprefixer":"10.4.14","babel-preset-solid":"1.7.7","eslint":"8.44.0","eslint-config-custom":"workspace:*","eslint-plugin-solid":"0.12.1","postcss":"8.4.26","react":"18.2.0","rollup":"3.26.2","rollup-plugin-postcss":"4.0.2","rollup-plugin-typescript-paths":"1.4.0","tailwindcss":"3.3.3","typescript":"5.1.6"},"_id":"@bot-flux/js@0.0.1","gitHead":"832dfe72f094b644d92a8a6f124e709a8e742466","_nodeVersion":"18.17.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-IjkAqQ7weeYOvnvgg29TjaRF5TdCeOrGApCQ46FFgZ+RaMNaNQk5aO2s6QHAcmUvB+xi1HUo62yUt2eD8MMmWA==","shasum":"c20b3614a0f23f9cea6e583d063d7832b0724892","tarball":"https://registry.npmjs.org/@bot-flux/js/-/js-0.0.1.tgz","fileCount":266,"unpackedSize":375130,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLV7ViEHqmBG9SQSmS/DgW/Y8L9maHAoE4u3BkmHpkrAIgTwwXT6JvG5YxKNn1SbipXvylBdZijw3rvwGjJsry1wg="}]},"_npmUser":{"name":"michelonsouza","email":"michelon.souza@hotmail.com"},"directories":{},"maintainers":[{"name":"michelonsouza","email":"michelon.souza@hotmail.com"},{"name":"lucashachi","email":"lucas@hachi.com.br"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js_0.0.1_1691500352244_0.39042333357371506"},"_hasShrinkwrap":false},"0.0.2":{"name":"@bot-flux/js","version":"0.0.2","description":"Javascript library to display botflux bots 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.54.1","@udecode/plate-common":"^21.1.5","eventsource-parser":"^1.0.0","solid-element":"1.7.1","solid-js":"1.7.8"},"devDependencies":{"@babel/preset-typescript":"7.22.5","@rollup/plugin-babel":"6.0.3","@rollup/plugin-node-resolve":"15.1.0","@rollup/plugin-terser":"0.4.3","@rollup/plugin-typescript":"11.1.2","@typebot.io/lib":"workspace:*","@typebot.io/schemas":"workspace:*","@typebot.io/tsconfig":"workspace:*","autoprefixer":"10.4.14","babel-preset-solid":"1.7.7","eslint":"8.44.0","eslint-config-custom":"workspace:*","eslint-plugin-solid":"0.12.1","postcss":"8.4.26","react":"18.2.0","rollup":"3.26.2","rollup-plugin-postcss":"4.0.2","rollup-plugin-typescript-paths":"1.4.0","tailwindcss":"3.3.3","typescript":"5.1.6"},"_id":"@bot-flux/js@0.0.2","gitHead":"832dfe72f094b644d92a8a6f124e709a8e742466","_nodeVersion":"18.17.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-Ic714drIuqtiWPHyhm+s7RfV2Hx6E0vpIdDV5YJcoX3PJz1Y+qK9sB1fWRVBDOSA/aKyX7eW8BGSjq8xYwy5rQ==","shasum":"8cec0c1a33fef2d754cc71dd443ba7935ee35be2","tarball":"https://registry.npmjs.org/@bot-flux/js/-/js-0.0.2.tgz","fileCount":266,"unpackedSize":375124,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCd5zO0fP6jAFYGBKXI1s3kzAPScp84QbFD05UaPNTdRgIgZywO88qQNnoVwF+HibXB/w6tQj1a/5NpxUErchs7U9I="}]},"_npmUser":{"name":"michelonsouza","email":"michelon.souza@hotmail.com"},"directories":{},"maintainers":[{"name":"michelonsouza","email":"michelon.souza@hotmail.com"},{"name":"lucashachi","email":"lucas@hachi.com.br"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js_0.0.2_1691500888047_0.7333023781551185"},"_hasShrinkwrap":false},"0.0.3":{"name":"@bot-flux/js","version":"0.0.3","description":"Javascript library to display botflux bots 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.54.1","@udecode/plate-common":"^21.1.5","eventsource-parser":"^1.0.0","solid-element":"1.7.1","solid-js":"1.7.8"},"devDependencies":{"@babel/preset-typescript":"7.22.5","@rollup/plugin-babel":"6.0.3","@rollup/plugin-node-resolve":"15.1.0","@rollup/plugin-terser":"0.4.3","@rollup/plugin-typescript":"11.1.2","@typebot.io/lib":"workspace:*","@typebot.io/schemas":"workspace:*","@typebot.io/tsconfig":"workspace:*","autoprefixer":"10.4.14","babel-preset-solid":"1.7.7","eslint":"8.44.0","eslint-config-custom":"workspace:*","eslint-plugin-solid":"0.12.1","postcss":"8.4.26","react":"18.2.0","rollup":"3.26.2","rollup-plugin-postcss":"4.0.2","rollup-plugin-typescript-paths":"1.4.0","tailwindcss":"3.3.3","typescript":"5.1.6"},"_id":"@bot-flux/js@0.0.3","gitHead":"832dfe72f094b644d92a8a6f124e709a8e742466","_nodeVersion":"18.17.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-KSMQr/qAenysTj6PShP9v/OYuSgaHebJmGohXG6XuuRc0Yqg0ZRg++a8MFc00OHui1L/bZ/05EG07cCX2pgHVQ==","shasum":"702f41ea9b816ab814efec1639a4bedd403a4920","tarball":"https://registry.npmjs.org/@bot-flux/js/-/js-0.0.3.tgz","fileCount":265,"unpackedSize":372088,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwMRbsxB/9JscaPmkMO3SGn8qM780kTPkEKRMmpe2ABQIhANoKf5EOfuH7f+giIkirtU9Rrv6/txdKZc99ZswswF55"}]},"_npmUser":{"name":"michelonsouza","email":"michelon.souza@hotmail.com"},"directories":{},"maintainers":[{"name":"michelonsouza","email":"michelon.souza@hotmail.com"},{"name":"lucashachi","email":"lucas@hachi.com.br"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js_0.0.3_1691501866446_0.09184409521284564"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-08T13:12:32.078Z","0.0.1":"2023-08-08T13:12:32.375Z","modified":"2023-08-08T13:37:46.743Z","0.0.2":"2023-08-08T13:21:28.254Z","0.0.3":"2023-08-08T13:37:46.634Z"},"maintainers":[{"name":"michelonsouza","email":"michelon.souza@hotmail.com"},{"name":"lucashachi","email":"lucas@hachi.com.br"}],"description":"Javascript library to display botflux bots on your website","license":"MIT","readme":"# Botflux JS library\n\nFrontend library to embed bots from [Botflux](https://botflux.io/).\n\n## Installation\n\n### Using npm\n\nTo install, simply run:\n\n```bash\nnpm install @bot-flux/js\n```\n\n### Directly in your HTML\n\n```\n<script type=\"module\">\n  import Botflux from 'https://cdn.jsdelivr.net/npm/@bot-flux/js@latest/dist/web.js'\n\n  Botflux.initStandard({\n    botflux: 'my-botflux',\n  })\n</script>\n\n<botflux-standard style=\"width: 100%; height: 600px; \"></botflux-standard>\n```\n\n## Standard\n\nYou can get the standard HTML and Javascript code by clicking on the \"HTML & Javascript\" button in the \"Share\" tab of your botflux.\n\nThere, you can change the container dimensions. Here is a code example:\n\n```html\n<script type=\"module\">\n  import Botflux from 'https://cdn.jsdelivr.net/npm/@bot-flux/js@latest/dist/web.js'\n\n  Botflux.initStandard({\n    botflux: 'my-botflux',\n  })\n</script>\n\n<botflux-standard style=\"width: 100%; height: 600px; \"></botflux-standard>\n```\n\nThis code is creating a container with a 100% width (will match parent width) and 600px height.\n\n## Popup\n\nYou can get the popup HTML and Javascript code by clicking on the \"HTML & Javascript\" button in the \"Share\" tab of your botflux.\n\nHere is an example:\n\n```html\n<script type=\"module\">\n  import Botflux from 'https://cdn.jsdelivr.net/npm/@bot-flux/js@latest/dist/web.js'\n\n  Botflux.initPopup({\n    botflux: 'my-botflux',\n    apiHost: 'http://localhost:3001',\n    autoShowDelay: 3000,\n  })\n</script>\n```\n\nThis code will automatically trigger the popup window after 3 seconds.\n\n### Open or Close a popup\n\nYou can use these commands:\n\n```js\nBotflux.open()\n```\n\n```js\nBotflux.close()\n```\n\n```js\nBotflux.toggle()\n```\n\nYou can bind these commands on a button element, for example:\n\n```html\n<button onclick=\"Botflux.open()\">Contact us</button>\n```\n\n## Bubble\n\nYou can get the bubble HTML and Javascript code by clicking on the \"HTML & Javascript\" button in the \"Share\" tab of your botflux.\n\nHere is an example:\n\n```html\n<script type=\"module\">\n  import Botflux from 'https://cdn.jsdelivr.net/npm/@bot-flux/js@latest/dist/web.js'\n\n  Botflux.initBubble({\n    botflux: 'my-botflux',\n    previewMessage: {\n      message: 'I have a question for you!',\n      autoShowDelay: 5000,\n      avatarUrl: 'https://avatars.githubusercontent.com/u/16015833?v=4',\n    },\n    theme: {\n      button: { backgroundColor: '#0042DA', iconColor: '#FFFFFF' },\n      previewMessage: { backgroundColor: '#ffffff', textColor: 'black' },\n      chatWindow: { backgroundColor: '#ffffff' },\n    },\n  })\n</script>\n```\n\nThis code will show the bubble and let a preview message appear after 5 seconds.\n\n### Open or close the preview message\n\nYou can use these commands:\n\n```js\nBotflux.showPreviewMessage()\n```\n\n```js\nBotflux.hidePreviewMessage()\n```\n\n### Open or close the botflux\n\nYou can use these commands:\n\n```js\nBotflux.open()\n```\n\n```js\nBotflux.close()\n```\n\n```js\nBotflux.toggle()\n```\n\nYou can bind these commands on a button element, for example:\n\n```html\n<button onclick=\"Botflux.open()\">Contact us</button>\n```\n\n## Additional configuration\n\nYou can prefill the bot variable values in your embed code by adding the `prefilledVariables` option. Here is an example:\n\n```js\nBotflux.initStandard({\n  botflux: 'my-botflux',\n  prefilledVariables: {\n    'Current URL': 'https://my-site/account',\n    'User name': 'John Doe',\n  },\n})\n```\n\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).\n\nNote that if your site URL contains query params (i.e. https://botflux.io?User%20name=John%20Doe), the variables will automatically be injected to the botflux. So you don't need to manually transfer query params to the bot embed configuration.\n","readmeFilename":"README.md"}