diff --git a/examples/with-axiom/middleware.js b/examples/with-axiom/middleware.js
deleted file mode 100644
index 9ff1b31aab37..000000000000
--- a/examples/with-axiom/middleware.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import { NextResponse } from 'next/server'
-import { log, withAxiom } from 'next-axiom'
-
-async function middleware(_req, ev) {
- log.info("Hello from middleware", { 'bar': 'baz' });
- return NextResponse.next()
-}
-
-export default withAxiom(middleware)
\ No newline at end of file
diff --git a/examples/with-axiom/middleware.ts b/examples/with-axiom/middleware.ts
new file mode 100644
index 000000000000..415b117e4fdf
--- /dev/null
+++ b/examples/with-axiom/middleware.ts
@@ -0,0 +1,9 @@
+import { NextResponse, NextRequest } from 'next/server'
+import { log, withAxiom } from 'next-axiom'
+
+async function middleware(_req: NextRequest) {
+ log.info("Hello from middleware", { 'bar': 'baz' })
+ return NextResponse.next()
+}
+
+export default withAxiom(middleware)
diff --git a/examples/with-axiom/package.json b/examples/with-axiom/package.json
index 9be5078a7e5e..f68957eb498a 100644
--- a/examples/with-axiom/package.json
+++ b/examples/with-axiom/package.json
@@ -11,5 +11,11 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"swr": "^1.3.0"
+ },
+ "devDependencies": {
+ "@types/react": "^18.0.5",
+ "@types/react-dom": "^18.0.1",
+ "@types/node": "^16.11.26",
+ "typescript": "^4.6.3"
}
}
\ No newline at end of file
diff --git a/examples/with-axiom/pages/_app.js b/examples/with-axiom/pages/_app.tsx
similarity index 56%
rename from examples/with-axiom/pages/_app.js
rename to examples/with-axiom/pages/_app.tsx
index 2cae5cb85614..5d22fa180cc5 100644
--- a/examples/with-axiom/pages/_app.js
+++ b/examples/with-axiom/pages/_app.tsx
@@ -1,11 +1,13 @@
+import React from 'react'
import { log } from 'next-axiom'
-
export { reportWebVitals } from 'next-axiom'
log.info('Hello from frontend', { foo: 'bar' })
-function MyApp({ Component, pageProps }) {
- return