Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cronitorio/cronitor-rum-nextjs
https://github.com/cronitorio/cronitor-rum-nextjs
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/cronitorio/cronitor-rum-nextjs
- Owner: cronitorio
- License: apache-2.0
- Created: 2022-11-30T15:22:58.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-05-30T07:27:22.000Z (over 1 year ago)
- Last Synced: 2024-10-01T18:09:09.483Z (about 2 months ago)
- Language: TypeScript
- Size: 76.2 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://cronitor.io/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.
```javascript
// ./pages/_app.jsimport { useCronitor } from '@cronitorio/cronitor-rum-nextjs';
function CustomApp({ Component, pageProps }) {
// Load Cronitor only once during the app lifecycle
useCronitor('YOUR_CLIENT_KEY');return ;
}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.
```javascript
// ./pages/_app.jsimport { useCronitor } from '@cronitorio/cronitor-rum-nextjs';
function CustomApp({ Component, pageProps }) {
useCronitor('YOUR_SITE_ID', {
debug: true,
environment: "staging",
includeURLQueryParams: ["tab", "pageNum"]
});return ;
}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]](mailto:[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](https://github.com/cronitorio/cronitor-rum-nextjs/blob/master/LICENSE).