npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@bentonow/bento-nextjs-sdk

v0.0.1-rc3

Published

🍱 Bento Next.JS SDK and tracking library

Readme

Bento Next.js SDK

[!TIP] Need help? Join our Discord or email [email protected] for personalized support.

The 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.

Get started with our 📚 integration guides, or 📘 browse the SDK reference.

Table of contents

Features

  • Easy integration: Quickly add Bento analytics to your Next.js application with pre-built components.
  • Page view tracking: Automatically track page views across your Next.js application.
  • User identification: Easily identify users for more detailed analytics.
  • Custom event tracking: Track custom events both on the client-side and server-side.
  • Next.js version support: Compatible with both Next.js 13+ and legacy versions.
  • Server-side integration: Optional server-side tracking with the Bento Node SDK.

Requirements

  • Next.js 12.0+ (with specific support for 13+)
  • Node.js 14+
  • Bento Account for a valid SITE_UUID

Getting started

Installation

Install the Bento Next.js SDK:

npm install @bentonow/bento-nextjs-sdk --save

Optionally, install the Bento Node SDK for server-side integration:

npm install @bentonow/bento-node-sdk --save

Configuration

Add the Bento analytics component to your top-level layout:

For Next.js 13+:

import { BentoAnalytics } from '@bentonow/bento-nextjs-sdk/analytics'

export default function Layout({ children }) {
  return (
    <html>
      <body>
        <BentoAnalytics siteUuid={process.env.NEXT_PUBLIC_BENTO_SITE_ID!} userEmail={''} />
        {children}
      </body>
    </html>
  )
}

For Next.js 12 (legacy):

import { BentoLegacyAnalytics } from '@bentonow/bento-nextjs-sdk/analytics/legacy'

function MyApp({ Component, pageProps }) {
  return (
    <>
      <BentoLegacyAnalytics siteUuid={process.env.NEXT_PUBLIC_BENTO_SITE_ID!} userEmail={''} />
      <Component {...pageProps} />
    </>
  )
}

Modules

Page View Tracking

Automatically track page views:

// Next.js 13+
import { useBentoAnalytics } from '@bentonow/bento-nextjs-sdk/analytics'

export default function Layout({ children }) {
  useBentoAnalytics(userEmail)
  return <>{children}</>
}

// Next.js 12 (legacy)
import { useBentoLegacyAnalytics } from '@bentonow/bento-nextjs-sdk/analytics/legacy'

function MyApp({ Component, pageProps }) {
  useBentoLegacyAnalytics(userEmail)
  return <Component {...pageProps} />
}

Custom Event Tracking

Track custom events on the client-side:

window.bento.track('optin', { organisation_name: 'Team Rocket' })
window.bento.tag('customer')

Track custom events on the server-side:

import { Analytics } from '@bentonow/bento-node-sdk'

const bento = new Analytics({ /* your configuration */ })

await bento.V1.track({
  email: '[email protected]',
  type: 'optin',
  fields: {
    organisation_name: 'Team Rocket'
  }
})

Things to Know

  1. The SDK provides different components for Next.js 13+ and legacy versions.
  2. Page view tracking is automatic when using the provided components and hooks.
  3. User identification can be done by passing the user's email to the analytics components or hooks.
  4. The SDK supports both client-side and server-side event tracking.
  5. For more advanced usage, you can customize the integration using the Next.js Script component.

Contributing

We welcome contributions! Please see our contributing guidelines for details on how to submit pull requests, report issues, and suggest improvements.

License

The Bento SDK for Next.js is available as open source under the terms of the MIT License.