Assuming I'm building a nitro api with aws-lambda preset, how do i pass a context object
I'm building my nitro api app with the aws-lambda preset:
In my event i want to pass some values (collected from an lambda or cognito authorizer) as the event.context, but i can't seem to get it to attach to the context and instead i have an object with
nitro
, _nitro
, matchedRoute
and params
only.
How to i pass the event authorizer supplied context to the handler such that will be accessible under event.context?2 Replies
Hi @Danny. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I'm sorry, but the knowledge sources do not contain explicit information about how to pass the AWS Lambda authorizer context into the Nitro event context when using the aws-lambda preset. The available documentation covers general usage of event context in server routes and how to attach custom data to event.context within handlers, but it does not detail integration with AWS Lambda's authorizer context or how to inject external context into Nitro's event object for this preset.
If you need to attach custom data to event.context, the standard approach is to do so within a handler or a Nitro plugin, but the mechanism for accessing AWS Lambda's authorizer context specifically is not described in the provided sources. You may need to consult the Nitro or Nuxt community or AWS Lambda integration documentation for more details on this use case.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@1085582253444304916> Kapa.ai is still learning and improving, please let me know how I did by reacting below.