Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Lambda Function URL Event Type

What is the exact event type from the @types/aws-lambda package for a Lambda function hosted using function URL?

like image 975
Raj Chaudhary Avatar asked Jun 15 '26 12:06

Raj Chaudhary


2 Answers

The Lambda Function URL request and response events use the Amazon API Gateway payload format version 2.0.

The corresponding TypeScript types are APIGatewayProxyEventV2 (request) and APIGatewayProxyResultV2<T> (response) in the @types/aws-lambda package.

/**
 * Works with HTTP API integration Payload Format version 2.0
 * @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
 */
export type APIGatewayProxyHandlerV2<T = never> = Handler<APIGatewayProxyEventV2, APIGatewayProxyResultV2<T>>;
like image 166
fedonev Avatar answered Jun 21 '26 21:06

fedonev


In .NET, following request and response objects are used when using Lambda with Function URLs.

  • APIGatewayHttpApiV2ProxyRequest
  • APIGatewayHttpApiV2ProxyResponse

You can find similar in typescript.

Probably APIGatewayEventRequestContextV2 should be the respective one. Anyway, you can explore all the available types here at api-gateway-proxy.d.ts.

like image 31
Ankush Jain Avatar answered Jun 21 '26 20:06

Ankush Jain