GithubHelp home page GithubHelp logo

cronitor-rum-nextjs's Introduction

Cronitor RUM Next.js integration

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

Official Cronitor Real User Monitoring integration for Next.js.

Quickstart

Install

Run the following command to install in your project:

npm install @cronitorio/cronitor-rum-nextjs

Or with yarn:

yarn add @cronitorio/cronitor-rum-nextjs

Basic usage

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

// ./pages/_app.js

import { useCronitor } from '@cronitorio/cronitor-rum-nextjs';

function CustomApp({ Component, pageProps }) {
  // Load Cronitor only once during the app lifecycle
  useCronitor('YOUR_CLIENT_KEY');

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

export default CustomApp;

Debug-mode

When developing in localhost, Cronitor 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 { useCronitor } from '@cronitorio/cronitor-rum-nextjs';

function CustomApp({ Component, pageProps }) {
  
  useCronitor('YOUR_SITE_ID', {
    debug: true,
    environment: "staging",
    includeURLQueryParams: ["tab", "pageNum"]
  });

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

export default CustomApp;

Changelog

0.4.0

  • Update cronitor-rum lib.

0.3.0

  • Update cronitor-rum-js lib.

0.2.1

  • Update cronitor-rum-js lib.

0.2.0

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

0.1.0

  • Initial open source release.

Security Disclosure

If you discover any issue regarding security, please disclose the information responsibly by sending us an email at [email protected]. Do NOT create a Issue on the GitHub repo.

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.

cronitor-rum-nextjs's People

Contributors

anthonynsimon avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

liakia345

cronitor-rum-nextjs's Issues

Next.js support

Hello, thanks for the cool integration
Not sure if this is an issue or a question...
I'm trying to use it in my next.js app (still using v12.x) and I cannot install it because this package set as peer deps next v13

Is this intended?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.