You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/vercel.mdx
+14-7Lines changed: 14 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Vercel provides a frictionless developer experience to take care of the hard thi
22
22
23
23
Vercel makes it easy for frontend teams to develop, preview, and ship delightful user experiences, where performance is the default.
24
24
25
-
## Sending logs to Axiom
25
+
## Send logs to Axiom
26
26
27
27
Simply install the [Axiom Vercel app from here](https://vercel.com/integrations/axiom) and be streaming logs and web vitals within minutes!
28
28
@@ -40,9 +40,11 @@ For function logs, if you call `console.log`, `console.warn` or `console.error`
40
40
41
41
Axiom supports capturing and analyzing Web Vital data directly from your user’s browser without any sampling and with more data than is available elsewhere. It is perfect to pair with Vercel’s in-built analytics when you want to get really deep into a specific problem or debug issues with a specific audience (user-agent, location, region, etc).
42
42
43
-
**NOTE: Web Vitals are only currently supported for Next.js websites. Expanded support is coming soon!**
43
+
<Note>
44
+
Web Vitals are only currently supported for Next.js websites. Expanded support is coming soon.
45
+
</Note>
44
46
45
-
####Installation
47
+
### Installation
46
48
47
49
Perform the following steps to install Web Vitals:
48
50
@@ -74,7 +76,9 @@ export default function RootLayout() {
74
76
}
75
77
```
76
78
77
-
**Note:** WebVitals are sent only from production deployments.
79
+
<Note>
80
+
WebVitals are sent only from production deployments.
81
+
</Note>
78
82
79
83
4. Deploy your site and watch data coming into your Axiom dashboard.
If you’re using Next.js version 12, follow the instructions below to integrate Axiom for logging and capturing Web Vitals data.
141
145
@@ -145,7 +149,7 @@ In your `pages/_app.js` or `pages/_app.ts` and add the following line:
145
149
export { reportWebVitals } from'next-axiom';
146
150
```
147
151
148
-
## Upgrading to Next.js 13 from Next.js 12
152
+
## Upgrade to Next.js 13 from Next.js 12
149
153
150
154
If you plan on upgrading to Next.js 13, you'll need to make specific changes to ensure compatibility:
151
155
@@ -235,7 +239,6 @@ You can **parse** the JSON using the [parse_json function](/apl/scalar-functions
235
239
236
240
- Check out our [APL Documentation on how to use more functions](/apl/scalar-functions/string-functions) and run your own queries against your Vercel logs.
237
241
238
-
239
242
## Migrate from Vercel app to next-axiom
240
243
241
244
In May 2024, Vercel [introduced higher costs](https://axiom.co/blog/changes-to-vercel-log-drains) for using Vercel Log Drains. Because the Axiom Vercel app depends on Log Drains, using the next-axiom library can be the cheaper option to analyze telemetry data for higher volume projects.
@@ -260,3 +263,7 @@ module.exports = withAxiom({
260
263
```
261
264
262
265
For more configuration options, see the [documentation in the next-axiom GitHub repository](https://github.com/axiomhq/next-axiom).
266
+
267
+
## Send logs from Vercel preview deployments
268
+
269
+
To send logs from Vercel preview deployments to Axiom, enable preview deployments for the environment variable `NEXT_PUBLIC_AXIOM_INGEST_ENDPOINT`. For more information, see the [Vercel documentation](https://vercel.com/docs/projects/environment-variables/managing-environment-variables).
0 commit comments