Releases: getsentry/sentry-javascript
7.31.0
The Next.js SDK now supports error and performance monitoring for Next.js middleware and Edge API routes.
To set it up, add a sentry.edge.config.js or sentry.edge.config.ts file to the root of your project and initialize the SDK:
// sentry.edge.config.js or sentry.edge.config.ts
import * as Sentry from "@sentry/nextjs";
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;
Sentry.init({
dsn: SENTRY_DSN || "YOUR DSN HERE",
tracesSampleRate: 1.0,
});The Next.js will automatically instrument Edge API routes and middleware.
If you want to opt out of automatic instrumentation of middleware can use the autoInstrumentMiddleware option in the sentry object of your Next.js configuration:
const moduleExports = {
sentry: {
autoInstrumentMiddleware: false,
},
};Middleware can be manually instrumented by using the wrapMiddlewareWithSentry function.
- feat(nextjs): Add Edge Runtime SDK (#6752)
- feat(nextjs): Add optional options argument to
withSentryConfigas an alternative to thesentryproperty (#6721) - feat(nextjs): Add edge route and middleware wrappers (#6771)
- feat(nextjs): Auto-wrap edge-routes and middleware (#6746)
- feat(replay): Update rrweb & rrweb-snapshot (#6749)
- feat(replay): Stop recording when retry fails (#6765)
- feat(replay): Stop without retry when receiving bad API response (#6773)
- feat(types): Add Trace Context type (#6714)
- fix(nextjs): Export isomorphic data fetching wrappers from client SDK (#6790)
- fix(nextjs): Make Next.js types isomorphic (#6707)
- fix(node): Handle node build without inspector in LocalVariables integration (#6780)
- fix(otel): Set trace context via Otel Span instead of Sentry span (#6724)
- fix(otel): Prevent baggage from being overwritten (#6709)
- fix(otel): Make sure we handle when sentry-trace is an empty array (#6781)
- fix(remix): Make remix SDK type exports isomorphic (#6715)
- fix(replay): Fix
checkoutEveryNms(#6722) - fix(replay): Fix incorrect uncompressed recording size due to encoding (#6740)
- fix(tracing): Attach request instrumentation span to active span instead of current transaction (#6778)
- ref(nextjs): Deprecate
isBuild()andIS_BUILD(#6727)
7.30.0
- feat(core): Add
addIntegrationmethod to client (#6651) - feat(core): Add
replay_eventtype for events (#6481) - feat(gatsby): Support Gatsby v5 (#6635)
- feat(integrations): Add HTTPClient integration (#6500)
- feat(node): Add
LocalVariablesintegration to capture local variables to stack frames (#6478) - feat(node): Check for invalid url in node transport (#6623)
- feat(replay): Remove
replayTypefrom tags and intoreplay_event(#6658) - feat(transport): Return result through Transport send (#6626)
- fix(nextjs): Don't wrap
res.jsonandres.send(#6674) - fix(nextjs): Don't write to
res.endto fixnext export(#6682) - fix(nextjs): Exclude SDK from Edge runtime bundles (#6683)
- fix(replay): Allow Replay to be used in Electron renderers with nodeIntegration enabled (#6644)
- fix(utils): Ignore stack frames over 1kb (#6627)
- ref(angular) Add error-like objects handling (#6446)
- ref(nextjs): Remove
instrumentSever(#6592)
Work in this release contributed by @rjoonas, @Naddiseo, and @theofidry. Thank you for your contributions!
7.29.0
This update includes a change to the @sentry/nextjs SDK that may increase response times of requests in applications
deployed to Vercel or AWS lambdas to ensure that error events are sent consistently.
Additionally, Next.js applications deployed to Vercel or AWS lambdas may also see an uptick in sent transactions. (for
more information see #6578)
- feat(core): Add
getSdkMetadatatoClient(#6643) - feat(nextjs): Send events consistently on platforms that don't support streaming (#6578)
- feat(replay): Use new
prepareEventutil & ensure dropping replays works (#6522) - feat(types): Upstream some replay types (#6506)
- fix(replay): Envelope send should be awaited in try/catch (#6625)
- fix(replay): Improve handling of
maskAllTextselector (#6637) - fix(tracing): Don't finish React Router 6
pageloadtransactions early (#6609)
7.28.1
7.28.0
7.27.0
This release exports the Session Replay integration via @sentry/browser and all framework SDKs building on top of it.
Going forward, the @sentry/replay package doesn't have to be installed explicitly to use Replay.
Furthermore, this release increases the maximim replay session duration from 30 minutes to 1 hour.
- feat(browser): Export
Replayintegration from Browser SDK (#6508) - feat(replay): Change
MAX_SESSION_LIFEto 1 hour (#6561) - feat(replay): Do not capture errors originating from rrweb (#6521)
- feat(replay): Flush immediately on DOM checkouts (#6463)
- fix(core): Make
beforeSendhandling defensive for different event types (#6507) - fix(replay): Ensure lodash.debounce does not trigger next.js warning (#6551)
- fix(replay): Make
maskAllTextselector more specific (#6544) - fix(replay): Send
dsnin envelope header if tunneling is active (#6568) - fix(utils): Don't attach context lines to stack frames without line number (#6549)
- ref(replay): Send SDK's name in replay event (#6514)
Work in this release contributed by @theofidry. Thank you for your contribution!
7.26.0
- feat(browser): Export event builder methods for use in other SDKs (#6515)
- feat(types): Add threads to Event (#6516)
- feat(nextjs): Add option to automatically tunnel events (#6425)
- fix(nextjs): Fix automatic release value discovery (#6513)
- ref(nextjs): Use generic loader to inject global values (#6484)
Work in this release contributed by @theofidry. Thank you for your contribution!
7.25.0
- feat(core): Add
scope.getLastBreadcrumb()(#6495) - feat(replay): Allow to opt-in to capture replay exceptions (#6482)
- feat(tracing): Add interaction transaction as an experiment (#6210)
- feat(types): Add profile envelope item type (#6468)
- fix(replay): Replace
_waitForErrorwithrecordingMode(#6489) - ref(replay): Inline lodash dependency into build (#6483)
- build(core): Do not mangle private methods used by Replay (#6493)
7.24.2
7.24.1
This patch corrects an oversight on our end which caused the Sentry Replay integration CDN bundles to be ignored when uploading bundles to our CDN.
If you want to use the Replay CDN bundles, please use version 7.24.1 or newer.
- fix(react): Add type for React Router's
encodeLocationmethod (#6439) - fix(replay): Add CDN bundle path to release artifacts (#6452)
- fix(tracing): Instrument cursors returned from MongoDB operations. (#6437)
- ref(angular): Extract zonejs error unwrapper into a dedicated function (#6443)
Work in this release contributed by @theofidry. Thank you for your contribution!