@@ -1094,29 +1094,29 @@ Wraps a callback with a cron monitor check in. The check in will be sent to Sent
10941094 import { headers } from " next/headers" ;
10951095
10961096 export default function ServerComponent() {
1097- async function myServerAction(formData : FormData ) {
1098- " use server" ;
1099- return await Sentry .withServerActionInstrumentation (
1100- " myServerAction" , // The name you want to associate this Server Action with in Sentry
1101- {
1102- formData , // Optionally pass in the form data
1103- headers: headers (), // Optionally pass in headers
1104- recordResponse: true , // Optionally record the server action response
1105- },
1106- async () => {
1107- // ... Your Server Action code
1097+ async function myServerAction(formData : FormData ) {
1098+ " use server" ;
1099+ return await Sentry .withServerActionInstrumentation (
1100+ " myServerAction" , // The name you want to associate this Server Action with in Sentry
1101+ {
1102+ formData , // Optionally pass in the form data
1103+ headers: await headers (), // Optionally pass in headers
1104+ recordResponse: true , // Optionally record the server action response
1105+ },
1106+ async () => {
1107+ // ... Your Server Action code
11081108
1109- return { name: " John Doe" };
1109+ return { name: " John Doe" };
1110+ }
1111+ );
11101112 }
1111- );
1112- }
11131113
1114- return (
1115- <form action = { myServerAction } >
1116- <input type = " text" name = " some-input-value" />
1117- <button type = " submit" >Run Action</button >
1118- </form >
1119- );
1114+ return (
1115+ <form action = { myServerAction } >
1116+ <input type = " text" name = " some-input-value" />
1117+ <button type = " submit" >Run Action</button >
1118+ </form >
1119+ );
11201120 }
11211121 ```
11221122
0 commit comments