Solid Middleware
Learn about Sentry's middleware for better instrumentation.
The Sentry middleware enhances the data collected by Sentry on the server side by enabling distributed tracing between the client and server.
Add the Sentry middleware to your middleware.ts
file. If you don't have a middleware.ts
file yet, create one:
middleware.ts
Copied
import { sentryBeforeResponseMiddleware } from "@sentry/solidstart/middleware";
import { createMiddleware } from "@solidjs/start/middleware";
export default createMiddleware({
onBeforeResponse: [
sentryBeforeResponseMiddleware(),
// Add your other middleware handlers after `sentryBeforeResponseMiddleware`
],
});
And specify middleware.ts
in app.config.ts
:
app.config.ts
Copied
import { defineConfig } from "@solidjs/start/config";
export default defineConfig({
// ...
middleware: "./src/middleware.ts",
});
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").