diff --git a/examples/nextjs/.eslintignore b/examples/nextjs/.eslintignore
deleted file mode 100644
index d7d56a9..0000000
--- a/examples/nextjs/.eslintignore
+++ /dev/null
@@ -1,11 +0,0 @@
-.github
-.next
-.yalc
-build
-bundles
-coverage
-dist
-lib
-node_modules
-out
-public
diff --git a/examples/nextjs/.eslintrc.json b/examples/nextjs/.eslintrc.json
index aee2189..3722418 100644
--- a/examples/nextjs/.eslintrc.json
+++ b/examples/nextjs/.eslintrc.json
@@ -1,7 +1,3 @@
{
- "root": true,
- "extends": ["next/core-web-vitals"],
- "rules": {
- "react/react-in-jsx-scope": "off"
- }
+ "extends": ["next/core-web-vitals", "next/typescript"]
}
diff --git a/examples/nextjs/.gitignore b/examples/nextjs/.gitignore
index 65a304a..26b002a 100644
--- a/examples/nextjs/.gitignore
+++ b/examples/nextjs/.gitignore
@@ -3,7 +3,12 @@
# dependencies
/node_modules
/.pnp
-.pnp.js
+.pnp.*
+.yarn/*
+!.yarn/patches
+!.yarn/plugins
+!.yarn/releases
+!.yarn/versions
# testing
/coverage
@@ -15,10 +20,6 @@
# production
/build
-# development
-/.yalc
-yalc.lock
-
# misc
.DS_Store
*.pem
@@ -27,16 +28,13 @@ yalc.lock
npm-debug.log*
yarn-debug.log*
yarn-error.log*
-.pnpm-debug.log*
-# local env files
-.env.local
-.env.development.local
-.env.test.local
-.env.production.local
+# env files (can opt-in for commiting if needed)
+.env*
# vercel
.vercel
# typescript
*.tsbuildinfo
+next-env.d.ts
diff --git a/examples/nextjs/README.md b/examples/nextjs/README.md
index 0849194..ef0e47e 100644
--- a/examples/nextjs/README.md
+++ b/examples/nextjs/README.md
@@ -1,14 +1,4 @@
-# Rollbar - Next.js example
-
-This project shows an example of how to add rollbar to your nextjs application.
-It requires a `.env.local` file to be set with a `NEXT_PUBLIC_ROLLBAR_TOKEN` variable.
-
-The important files are `pages/_app.tsx` where it renders a rollbar provider
-and `pages/index.tsx` where it sends a message and throws an error.
-
----
-
-This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
+This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/pages/api-reference/create-next-app).
## Getting Started
@@ -18,27 +8,33 @@ First, run the development server:
npm run dev
# or
yarn dev
+# or
+pnpm dev
+# or
+bun dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
-[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
+[API routes](https://nextjs.org/docs/pages/building-your-application/routing/api-routes) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
+
+The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/pages/building-your-application/routing/api-routes) instead of React pages.
-The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
+This project uses [`next/font`](https://nextjs.org/docs/pages/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
## Learn More
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
-- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
+- [Learn Next.js](https://nextjs.org/learn-pages-router) - an interactive Next.js tutorial.
-You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
+You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
-Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
+Check out our [Next.js deployment documentation](https://nextjs.org/docs/pages/building-your-application/deploying) for more details.
diff --git a/examples/nextjs/next-env.d.ts b/examples/nextjs/next-env.d.ts
index 4f11a03..a4a7b3f 100644
--- a/examples/nextjs/next-env.d.ts
+++ b/examples/nextjs/next-env.d.ts
@@ -2,4 +2,4 @@
///
// NOTE: This file should not be edited
-// see https://nextjs.org/docs/basic-features/typescript for more information.
+// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
diff --git a/examples/nextjs/next.config.js b/examples/nextjs/next.config.js
deleted file mode 100644
index a5d8ee8..0000000
--- a/examples/nextjs/next.config.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/**
- * @type {import('next').NextConfig}
- */
-const nextConfig = {
- reactStrictMode: true,
-};
-
-module.exports = nextConfig;
diff --git a/examples/nextjs/next.config.ts b/examples/nextjs/next.config.ts
new file mode 100644
index 0000000..3915163
--- /dev/null
+++ b/examples/nextjs/next.config.ts
@@ -0,0 +1,8 @@
+import type { NextConfig } from "next";
+
+const nextConfig: NextConfig = {
+ /* config options here */
+ reactStrictMode: true,
+};
+
+export default nextConfig;
diff --git a/examples/nextjs/pages/_app.tsx b/examples/nextjs/pages/_app.tsx
deleted file mode 100644
index ad1f629..0000000
--- a/examples/nextjs/pages/_app.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import React from 'react';
-import '../styles/globals.css';
-import type { AppProps } from 'next/app';
-import { Provider, ErrorBoundary } from '@rollbar/react';
-
-const rollbarConfig = {
- accessToken: process.env.NEXT_PUBLIC_ROLLBAR_TOKEN,
- hostSafeList: ['localhost:3000', 'localhost:4000'],
- captureUncaught: true,
- captureUnhandledRejections: true,
- payload: {
- environment: 'development',
- client: {
- javascript: {
- code_version: '1.0.0',
- source_map_enabled: true,
- },
- },
- },
-};
-
-function MyApp({ Component, pageProps }: AppProps) {
- return (
-
- (
-
Oops, there was an error.
- )}
- extra={{ more: 'data' }}
- callback={() => console.log('an exception was sent to rollbar')}
- >
-
-
-
- );
-}
-
-export default MyApp;
diff --git a/examples/nextjs/pages/index.tsx b/examples/nextjs/pages/index.tsx
deleted file mode 100644
index 0dab179..0000000
--- a/examples/nextjs/pages/index.tsx
+++ /dev/null
@@ -1,66 +0,0 @@
-import React from 'react';
-import type { NextPage } from 'next';
-import Head from 'next/head';
-import Image from 'next/image';
-import { useCallback, useState } from 'react';
-import styles from '../styles/Home.module.css';
-
-import { useRollbar, RollbarContext } from '@rollbar/react';
-
-const Home: NextPage = () => {
- const rollbar = useRollbar();
-
- const sendMessage = useCallback(() => {
- rollbar.info('manual message');
- }, [rollbar]);
-
- const [errorState, setErrorState] = useState(false);
-
- if (errorState) {
- throw new Error('uncaught error (nextjs)');
- }
-
- return (
-
-