You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<divtw="flex">The user's username is {ctx.message.requesterUserData.username}</div>
40
+
<divtw="flex">
41
+
The user's username is {ctx.message.requesterUserData.username}
42
+
</div>
41
43
),
42
44
};
43
45
});
@@ -73,7 +75,7 @@ export const POST = frames(
73
75
74
76
## Defining your own middleware
75
77
76
-
You can define your own middleware by creating a function that returns a promise that resolves to the next middleware, or a [Web API `Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response), or a `FrameDefinition`.
78
+
You can define your own middleware by creating a function that returns a promise that resolves to the next middleware, or a [Web API `Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response), or a [`FrameDefinition`](/reference/core/createFrames#framedefinition).
77
79
78
80
Middleware can modify the context or return a response that will terminate the request early.
79
81
@@ -84,10 +86,10 @@ Middleware can modify the context or return a response that will terminate the r
Sometimes you want to access the request object in your middleware - whenever you do this, you should clone the request object to avoid mutating it and breaking other middleware.
127
+
128
+
Here's an example of creating middleware which will add the request json to your context:
0 commit comments