Skip to content

Commit d76fe81

Browse files
Add node docs for tRPC middleware (#6620)
Co-authored-by: Shana Matthews <[email protected]>
1 parent d69e159 commit d76fe81

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/platforms/node/common/configuration/integrations/pluggable-integrations.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,26 @@ Sentry.init({
137137
tracePropagationTargets: ["my-site-url.com"],
138138
});
139139
```
140+
141+
## Frameworks
142+
143+
### tRPC Middleware
144+
145+
_(New in version 7.48.0)_
146+
147+
The Sentry tRPC middleware helps make sure your transactions related to RPCs are well-named.
148+
Additionally, it can attach RPC input via the `attachRpcInput` option.
149+
150+
```typescript
151+
import { initTRPC } from "@trpc/server";
152+
import * as Sentry from "@sentry/node";
153+
154+
const t = initTRPC.context().create();
155+
const sentryMiddleware = t.middleware(
156+
Sentry.Handlers.trpcMiddleware({
157+
attachRpcInput: true,
158+
})
159+
);
160+
161+
const sentrifiedProcedure = t.procedure.use(sentryMiddleware);
162+
```

0 commit comments

Comments
 (0)