Skip to main content
A Vercel log drain sends your app’s log lines to Squasher. The SDK sends errors as events with stack frames and request data. Keep both: the drain still covers code that the SDK cannot see.

What moves and what does not

Run both side by side

Keep the drain on while you add the SDK. Squasher groups SDK events and drain lines separately. One failure can show up as two issues: one from the SDK with a stack trace, and one from the log line.

Add the SDK

1

Install the packages

2

Add the environment variables in Vercel

Add SQUASHER_API_KEY and SQUASHER_PROJECT_ID to your Vercel project. Use the same Squasher project as the drain, so that both sources land in one place. For browser code, also add NEXT_PUBLIC_SQUASHER_API_KEY and NEXT_PUBLIC_SQUASHER_PROJECT_ID.
3

Initialize the SDK on the server

instrumentation.ts
On Vercel, the SDK sets the release from VERCEL_GIT_COMMIT_SHA when that variable is set.
4

Wrap your route handlers

app/api/checkout/route.ts
For middleware, Server Components, and the browser, see the Next.js SDK.
5

Deploy and send a test error

Deploy, then throw an error from a wrapped route handler. Select Issues in the Squasher sidebar. The SDK issue shows the stack frames and the request URL.

Move alerts

Check your notification routes after the first deploy with the SDK. The SDK can open new issues for errors that the drain already reported, so the same failure can notify twice.

Check parity

  • For one test error, find the SDK issue and the drain log line.
  • Check that the SDK events have the commit of the deployment as their release.
  • Compare the number of issues for one week before and after the SDK.

Decide whether to keep the drain

Keep the drain if you run code on the Edge runtime, or if you use the Vercel logs in Squasher. To remove it, see Vercel.

Next steps

Next.js SDK

Capture middleware, Server Component, and browser errors.

Browser SDK

Set sampling, session replay, and privacy options.

Vercel

Manage the log drain and Vercel traces.

Upload source maps

Store source maps for each release.