{"_id":"@bot-flux/nextjs","name":"@bot-flux/nextjs","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@bot-flux/nextjs","version":"0.0.1","description":"Convenient library to display botflux bots on your Next.js website","main":"dist/index.js","types":"dist/index.d.ts","type":"module","scripts":{"dev":"rollup --watch --config rollup.config.js","build":"rollup --config rollup.config.js","lint":"eslint --fix \"src/**/*.ts*\""},"keywords":[],"author":{"name":"Baptiste Arnaud"},"license":"ISC","devDependencies":{"@babel/preset-react":"7.22.5","@babel/preset-typescript":"7.22.5","@rollup/plugin-alias":"^5.0.0","@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/js":"workspace:*","@typebot.io/react":"workspace:*","@typebot.io/lib":"workspace:*","@typebot.io/prisma":"workspace:*","@typebot.io/schemas":"workspace:*","@typebot.io/tsconfig":"workspace:*","@types/node":"20.4.2","@types/react":"18.2.15","eslint":"8.44.0","eslint-config-custom":"workspace:*","react":"18.2.0","rollup":"3.26.2","rollup-plugin-typescript-paths":"1.4.0","tslib":"2.6.0","tsx":"3.12.7","typescript":"5.1.6"},"peerDependencies":{"next":"12.x || 13.x","react":"18.x"},"_id":"@bot-flux/nextjs@0.0.1","gitHead":"832dfe72f094b644d92a8a6f124e709a8e742466","_nodeVersion":"18.17.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-GzvF6V9fzDbFS3ExaNOBwQ3r6g7R86xSXper7fofBUjcKsB/PQ3h28KhoAUpV/m7///Fr9eM9b65shClFDbRXw==","shasum":"2f3f42e0c61245ae0bfc5a10d9e5f670f8512a7c","tarball":"https://registry.npmjs.org/@bot-flux/nextjs/-/nextjs-0.0.1.tgz","fileCount":40,"unpackedSize":1633349,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICJ3uV0wLE2+EAkDOm3LLjnKgxvYO7yyiSXczWt0M2W+AiBZk9ovaCZhKe1UDsRkaCt3Vy5OzPMj2bfwqAZJlxaGvQ=="}]},"_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/nextjs_0.0.1_1691502778260_0.27622782752721453"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-08T13:52:58.187Z","0.0.1":"2023-08-08T13:52:58.500Z","modified":"2023-08-08T13:52:58.675Z"},"maintainers":[{"name":"michelonsouza","email":"michelon.souza@hotmail.com"},{"name":"lucashachi","email":"lucas@hachi.com.br"}],"description":"Convenient library to display botflux bots on your Next.js website","keywords":[],"author":{"name":"Baptiste Arnaud"},"license":"ISC","readme":"## Install\n\n```bash\nnpm install @bot-flux/nextjs\n```\n\n## Standard\n\n```tsx\nimport { Standard } from '@bot-flux/nextjs'\n\nconst App = () => {\n  return (\n    <Standard\n      botflux=\"lead-generation-copy-3luzm6b\"\n      style={{ width: '100%', height: '600px' }}\n    />\n  )\n}\n```\n\nThis code is creating a container with a 100% width (will match parent width) and 600px height.\n\n## Popup\n\n```tsx\nimport { Popup } from '@bot-flux/nextjs'\n\nconst App = () => {\n  return <Popup botflux=\"lead-generation-copy-3luzm6b\" autoShowDelay={3000} />\n}\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\nimport { open } from '@bot-flux/nextjs'\n\nopen()\n```\n\n```js\nimport { close } from '@bot-flux/nextjs'\n\nclose()\n```\n\n```js\nimport { toggle } from '@bot-flux/nextjs'\n\ntoggle()\n```\n\n## Bubble\n\n```tsx\nimport { Bubble } from '@bot-flux/nextjs'\n\nconst App = () => {\n  return (\n    <Bubble\n      botflux=\"lead-generation-copy-3luzm6b\"\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      }}\n    />\n  )\n}\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\nimport { showPreviewMessage } from '@bot-flux/nextjs'\n\nBotflux.showPreviewMessage()\n```\n\n```js\nimport { hidePreviewMessage } from '@bot-flux/nextjs'\n\nBotflux.hidePreviewMessage()\n```\n\n### Open or close the chat window\n\nYou can use these commands:\n\n```js\nimport { open } from '@bot-flux/nextjs'\n\nopen()\n```\n\n```js\nimport { close } from '@bot-flux/nextjs'\n\nclose()\n```\n\n```js\nimport { toggle } from '@bot-flux/nextjs'\n\ntoggle()\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```tsx\nimport { Standard } from '@bot-flux/nextjs'\n\nconst App = () => {\n  return (\n    <Standard\n      botflux=\"lead-generation-copy-3luzm6b\"\n      style={{ width: '100%', height: '600px' }}\n      prefilledVariables={{\n        'Current URL': 'https://my-site/account',\n        'User name': 'John Doe',\n      }}\n    />\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"}