{"_id":"@bentonow/bento-nextjs-sdk","_rev":"2-db7275c89c5552ebe90bb8d0ff215fc0","name":"@bentonow/bento-nextjs-sdk","dist-tags":{"latest":"0.0.1-rc3"},"versions":{"0.0.1-rc1":{"name":"@bentonow/bento-nextjs-sdk","version":"0.0.1-rc1","keywords":["bento","typescript","nextjs"],"author":{"name":"Backpack Internet"},"license":"MIT","_id":"@bentonow/bento-nextjs-sdk@0.0.1-rc1","maintainers":[{"name":"bentonow","email":"jesse@bentonow.com"}],"homepage":"https://bentonow.com","bugs":{"url":"https://github.com/bentonow/bento-nextjs-sdk/issues"},"dist":{"shasum":"be1134e912cf699f1e4bb9029a49ba53d8e6576c","tarball":"https://registry.npmjs.org/@bentonow/bento-nextjs-sdk/-/bento-nextjs-sdk-0.0.1-rc1.tgz","fileCount":3,"integrity":"sha512-dHdEBpJTabtQSm0/romvPjBJ+8H/Dc4Xk3XPRVF1d7frANA5fsuITJrIph2Y5msRcRm4dj+7nQRillqFNRVXWw==","signatures":[{"sig":"MEUCIDoOZAU+cs6k6kuXZRxl84/djkqb2XqLfDOSwRM37vTyAiEAuQWEhK14WlD1j+YUXCUwOWEclbe84bfZCKwDS/v7c+g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5416},"types":"./dist/types/index.d.ts","engines":{"node":">=18.17.0"},"exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"./analytics":{"types":"./dist/types/analytics/index.d.ts","import":"./dist/esm/analytics/index.js","require":"./dist/cjs/analytics/index.js"},"./analytics/legacy":{"types":"./dist/types/analytics/legacy/index.d.ts","import":"./dist/esm/analytics/legacy/index.js","require":"./dist/cjs/analytics/legacy/index.js"}},"gitHead":"1289b1cc4e1275d68ddc4b5b6b7dd4010efc17f0","scripts":{"dev":"tsup --watch","build":"npm run clean && tsup && tsc -p tsconfig.library.json","clean":"rimraf ./dist"},"_npmUser":{"name":"bentonow","email":"jesse@bentonow.com"},"repository":{"url":"git+https://github.com/bentonow/bento-nextjs-sdk.git","type":"git"},"_npmVersion":"10.5.2","description":"🍱 Bento Next.JS SDK and tracking library","directories":{},"_nodeVersion":"20.13.1","_hasShrinkwrap":false,"devDependencies":{"next":"^14.2.3","tsup":"^8.0.2","rimraf":"^5.0.7","prettier":"^3.2.5","typescript":"^5.4.5","@types/react":"^18.3.3","@types/react-dom":"^18.3.0"},"peerDependencies":{"next":"^12.0.0 || ^13.0.0 || ^14.0.0 || >=15.0.0-rc","react":"^17.0.0 || ^18.0.0 || >=19.0.0-beta"},"_npmOperationalInternal":{"tmp":"tmp/bento-nextjs-sdk_0.0.1-rc1_1717476362270_0.5224761319120228","host":"s3://npm-registry-packages"}},"0.0.1-rc2":{"name":"@bentonow/bento-nextjs-sdk","version":"0.0.1-rc2","keywords":["bento","typescript","nextjs"],"author":{"name":"Backpack Internet"},"license":"MIT","_id":"@bentonow/bento-nextjs-sdk@0.0.1-rc2","maintainers":[{"name":"bentonow","email":"jesse@bentonow.com"}],"homepage":"https://bentonow.com","bugs":{"url":"https://github.com/bentonow/bento-nextjs-sdk/issues"},"dist":{"shasum":"f30acee8884468afc55b0e05d0ca71715a8b9c84","tarball":"https://registry.npmjs.org/@bentonow/bento-nextjs-sdk/-/bento-nextjs-sdk-0.0.1-rc2.tgz","fileCount":45,"integrity":"sha512-dPLMY1I2wkmf91/SaVIeqakE5Fa7Ws5LzjSti4D+9xrdD9my2PaULzOX++TlCVRATCXxtvvvMX4msr7T1a4xAQ==","signatures":[{"sig":"MEUCIQCsEkfhI2R+79OdeDoGUM5Wvm/5jQsEYvEILx4V6koSjwIgNiVxGBKtvOuD7EduIMfwf3b1ElN/FPyeQa/UZU/LvUA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":34145},"types":"./dist/types/index.d.ts","engines":{"node":">=18.17.0"},"exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"./analytics":{"types":"./dist/types/analytics/index.d.ts","import":"./dist/esm/analytics/index.js","require":"./dist/cjs/analytics/index.js"},"./analytics/legacy":{"types":"./dist/types/analytics/legacy/index.d.ts","import":"./dist/esm/analytics/legacy/index.js","require":"./dist/cjs/analytics/legacy/index.js"}},"gitHead":"77ac9e2404260f5e539e2ffe5180fd9b0494d8ee","scripts":{"dev":"tsup --watch","build":"npm run clean && tsup && tsc -p tsconfig.library.json","clean":"rimraf ./dist"},"_npmUser":{"name":"bentonow","email":"jesse@bentonow.com"},"repository":{"url":"git+https://github.com/bentonow/bento-nextjs-sdk.git","type":"git"},"_npmVersion":"10.5.2","description":"🍱 Bento Next.JS SDK and tracking library","directories":{},"_nodeVersion":"20.13.1","_hasShrinkwrap":false,"devDependencies":{"next":"^14.2.3","tsup":"^8.0.2","rimraf":"^5.0.7","prettier":"^3.2.5","typescript":"^5.4.5","@types/react":"^18.3.3","@types/react-dom":"^18.3.0"},"peerDependencies":{"next":"^12.0.0 || ^13.0.0 || ^14.0.0 || >=15.0.0-rc","react":"^17.0.0 || ^18.0.0 || >=19.0.0-beta"},"_npmOperationalInternal":{"tmp":"tmp/bento-nextjs-sdk_0.0.1-rc2_1717477702931_0.20461106442285404","host":"s3://npm-registry-packages"}},"0.0.1-rc3":{"name":"@bentonow/bento-nextjs-sdk","version":"0.0.1-rc3","description":"🍱 Bento Next.JS SDK and tracking library","types":"./dist/types/index.d.ts","exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"./analytics":{"types":"./dist/types/analytics/index.d.ts","import":"./dist/esm/analytics/index.js","require":"./dist/cjs/analytics/index.js"},"./analytics/legacy":{"types":"./dist/types/analytics/legacy/index.d.ts","import":"./dist/esm/analytics/legacy/index.js","require":"./dist/cjs/analytics/legacy/index.js"}},"scripts":{"build":"npm run clean && tsup && tsc -p tsconfig.library.json","clean":"rimraf ./dist","dev":"tsup --watch"},"repository":{"type":"git","url":"git+https://github.com/bentonow/bento-nextjs-sdk.git"},"keywords":["bento","typescript","nextjs"],"author":{"name":"Backpack Internet"},"license":"MIT","bugs":{"url":"https://github.com/bentonow/bento-nextjs-sdk/issues"},"homepage":"https://bentonow.com","devDependencies":{"@types/react":"^18.3.3","@types/react-dom":"^18.3.0","next":"^14.2.3","prettier":"^3.2.5","rimraf":"^5.0.7","tsup":"^8.0.2","typescript":"^5.4.5"},"peerDependencies":{"next":"^12.0.0 || ^13.0.0 || ^14.0.0 || >=15.0.0-rc","react":"^17.0.0 || ^18.0.0 || >=19.0.0-beta"},"engines":{"node":">=18.17.0"},"_id":"@bentonow/bento-nextjs-sdk@0.0.1-rc3","gitHead":"784bdaf4882d7cb3fb735df21b2ef9e9fa1a5f5e","_nodeVersion":"20.18.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-lQwYw6M3fbt0ZRE07UfDyKnvV8Qm6X1xK04SMwzmUpuXO+6zwJxDeVhMqi2+MSKE929D9lPCjUy3Lj5HIr4PSg==","shasum":"e2892ba895c4e828d90c25a4465eee36066f7cba","tarball":"https://registry.npmjs.org/@bentonow/bento-nextjs-sdk/-/bento-nextjs-sdk-0.0.1-rc3.tgz","fileCount":51,"unpackedSize":38015,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDAcQKP0Mo0qz9hxBxFh4M4aq0wlmmERgf6+1jUiZNI9gIhAIOMEaRXd0jeagxX2wO+SXLPB/T2ruXXENXItuakFLoB"}]},"_npmUser":{"name":"bentonow","email":"jesse@bentonow.com"},"directories":{},"maintainers":[{"name":"bentonow","email":"jesse@bentonow.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bento-nextjs-sdk_0.0.1-rc3_1735347601067_0.8019066594522963"},"_hasShrinkwrap":false}},"time":{"created":"2024-06-04T04:46:02.134Z","modified":"2024-12-28T01:00:01.451Z","0.0.1-rc1":"2024-06-04T04:46:02.408Z","0.0.1-rc2":"2024-06-04T05:08:23.113Z","0.0.1-rc3":"2024-12-28T01:00:01.274Z"},"bugs":{"url":"https://github.com/bentonow/bento-nextjs-sdk/issues"},"author":{"name":"Backpack Internet"},"license":"MIT","homepage":"https://bentonow.com","keywords":["bento","typescript","nextjs"],"repository":{"type":"git","url":"git+https://github.com/bentonow/bento-nextjs-sdk.git"},"description":"🍱 Bento Next.JS SDK and tracking library","maintainers":[{"name":"bentonow","email":"jesse@bentonow.com"}],"readme":"# Bento Next.js SDK\n<img align=\"right\" src=\"https://app.bentonow.com/brand/logoanim.gif\">\n\n> [!TIP]\n> Need help? Join our [Discord](https://discord.gg/ssXXFRmt5F) or email jesse@bentonow.com for personalized support.\n\nThe Bento Next.js SDK makes it quick and easy to build an excellent analytics experience in your Next.js application. We provide powerful and customizable components and hooks that can be used out-of-the-box to track your users' behavior and manage analytics. We also expose low-level APIs so that you can build fully custom experiences.\n\nGet started with our [📚 integration guides](https://docs.bentonow.com), or [📘 browse the SDK reference](https://docs.bentonow.com/subscribers).\n\nTable of contents\n=================\n\n<!--ts-->\n* [Features](#features)\n* [Requirements](#requirements)\n* [Getting started](#getting-started)\n    * [Installation](#installation)\n    * [Configuration](#configuration)\n* [Modules](#modules)\n* [Things to Know](#things-to-know)\n* [Contributing](#contributing)\n* [License](#license)\n<!--te-->\n\n## Features\n\n* **Easy integration**: Quickly add Bento analytics to your Next.js application with pre-built components.\n* **Page view tracking**: Automatically track page views across your Next.js application.\n* **User identification**: Easily identify users for more detailed analytics.\n* **Custom event tracking**: Track custom events both on the client-side and server-side.\n* **Next.js version support**: Compatible with both Next.js 13+ and legacy versions.\n* **Server-side integration**: Optional server-side tracking with the Bento Node SDK.\n\n## Requirements\n\n- Next.js 12.0+ (with specific support for 13+)\n- Node.js 14+\n- Bento Account for a valid **SITE_UUID**\n\n## Getting started\n\n### Installation\n\nInstall the Bento Next.js SDK:\n\n```bash\nnpm install @bentonow/bento-nextjs-sdk --save\n```\n\nOptionally, install the Bento Node SDK for server-side integration:\n\n```bash\nnpm install @bentonow/bento-node-sdk --save\n```\n\n### Configuration\n\nAdd the Bento analytics component to your top-level layout:\n\nFor Next.js 13+:\n\n```jsx\nimport { BentoAnalytics } from '@bentonow/bento-nextjs-sdk/analytics'\n\nexport default function Layout({ children }) {\n  return (\n    <html>\n      <body>\n        <BentoAnalytics siteUuid={process.env.NEXT_PUBLIC_BENTO_SITE_ID!} userEmail={''} />\n        {children}\n      </body>\n    </html>\n  )\n}\n```\n\nFor Next.js 12 (legacy):\n\n```jsx\nimport { BentoLegacyAnalytics } from '@bentonow/bento-nextjs-sdk/analytics/legacy'\n\nfunction MyApp({ Component, pageProps }) {\n  return (\n    <>\n      <BentoLegacyAnalytics siteUuid={process.env.NEXT_PUBLIC_BENTO_SITE_ID!} userEmail={''} />\n      <Component {...pageProps} />\n    </>\n  )\n}\n```\n\n## Modules\n\n### Page View Tracking\n\nAutomatically track page views:\n\n```jsx\n// Next.js 13+\nimport { useBentoAnalytics } from '@bentonow/bento-nextjs-sdk/analytics'\n\nexport default function Layout({ children }) {\n  useBentoAnalytics(userEmail)\n  return <>{children}</>\n}\n\n// Next.js 12 (legacy)\nimport { useBentoLegacyAnalytics } from '@bentonow/bento-nextjs-sdk/analytics/legacy'\n\nfunction MyApp({ Component, pageProps }) {\n  useBentoLegacyAnalytics(userEmail)\n  return <Component {...pageProps} />\n}\n```\n\n### Custom Event Tracking\n\nTrack custom events on the client-side:\n\n```javascript\nwindow.bento.track('optin', { organisation_name: 'Team Rocket' })\nwindow.bento.tag('customer')\n```\n\nTrack custom events on the server-side:\n\n```javascript\nimport { Analytics } from '@bentonow/bento-node-sdk'\n\nconst bento = new Analytics({ /* your configuration */ })\n\nawait bento.V1.track({\n  email: 'user@example.com',\n  type: 'optin',\n  fields: {\n    organisation_name: 'Team Rocket'\n  }\n})\n```\n\n## Things to Know\n\n1. The SDK provides different components for Next.js 13+ and legacy versions.\n2. Page view tracking is automatic when using the provided components and hooks.\n3. User identification can be done by passing the user's email to the analytics components or hooks.\n4. The SDK supports both client-side and server-side event tracking.\n5. For more advanced usage, you can customize the integration using the Next.js Script component.\n\n## Contributing\n\nWe welcome contributions! Please see our [contributing guidelines](CODE_OF_CONDUCT.md) for details on how to submit pull requests, report issues, and suggest improvements.\n\n## License\n\nThe Bento SDK for Next.js is available as open source under the terms of the [MIT License](LICENSE.md).\n","readmeFilename":"README.md"}