Skip to content

Make SvelteKit sentryHandle request handler a factory function  #7951

@Lms24

Description

@Lms24

Right now, the sentryHandle function is just a plain request handler. This comes the disadvantage that we cannot pass arguments to configure it, if we ever wanted to allow customization of its behaviour. Therefore, we should convert it to a factory function that returns a handler:

// hooks.server.js

// old
export const handle = sequence(sentryHandle, /* other handlers */);

// new
export const handle = sequence(sentryHandle(), /* other handlers */)

// so that in the future we could do things like
export const handle = sequence(
  sentryHandle({ tracePageLoads: true, traceDataRequests: false }), 
  /* other handlers */
)

We'll do this right now to avoid legacy API before GA

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions