This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@panelbear/panelbear-nextjs
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Panelbear Next.js integration

Important: As of version 2.0.1 of this package only Next.js 13 or later will be supported. For previous versions of Next.js please install version 1.0.5 of this package.

Official Panelbear integration for Next.js.

Quickstart

Install

Run the following command to install in your project:

npm install @panelbear/panelbear-nextjs

Or with yarn:

yarn add @panelbear/panelbear-nextjs

Basic usage

You can now import, and use the Panelbear hook on your project.

// ./pages/_app.js

import { usePanelbear } from '@panelbear/panelbear-nextjs';

function CustomApp({ Component, pageProps }) {
  // Load Panelbear only once during the app lifecycle
  usePanelbear('YOUR_SITE_ID');

  return <Component {...pageProps} />;
}

export default CustomApp;

Debug-mode

When developing in localhost, Panelbear does not send events to avoid using your quota.

You can enable debug mode to send events when testing things locally. It will also log messages to console.

// ./pages/_app.js

import { usePanelbear } from '@panelbear/panelbear-nextjs';

function CustomApp({ Component, pageProps }) {
  
  usePanelbear('YOUR_SITE_ID', {
    debug: true
  });

  return <Component {...pageProps} />;
}

export default CustomApp;

Changelog

2.0.1

  • Fix breaking change to function export level

2.0.0

  • Support new Next.js 13 'app' directory and client-only components.

1.0.5

  • Add peer dependency support for NextJS 13.

1.0.4

  • Add peer dependency support for React 18.

1.0.3

  • Update peer dependencies

1.0.2

  • Upgrade deps

1.0.1

  • Update docs

1.0.0

  • Initial open source release.

Security Disclosure

If you discover any issue regarding security, please disclose the information responsibly by following the instructions here. Do NOT create a Issue on the GitHub repo.

Contributors

@anthonynsimon @EndBug

Alternatives

For community alternatives to this package, you can check out:

Contributing

Please check for any existing issues before openning a new Issue. If you'd like to work on something, please open a new Issue describing what you'd like to do before submitting a Pull Request.

License

See LICENSE.

Package Sidebar

Install

npm i @panelbear/panelbear-nextjs

Weekly Downloads

3

Version

2.0.1

License

Apache-2.0

Unpacked Size

18 kB

Total Files

8

Last publish

Collaborators

  • anthonynsimon