# Lambda handler types in v3: import them from aws-lambda, not client-lambda

## TL;DR

In AWS SDK v3, @aws-sdk/client-lambda types the Lambda management API (InvokeCommand, CreateFunctionCommand), not your handler. For the handler signature itself, install the separate aws-lambda package: import { APIGatewayProxyHandler, SQSHandler } from 'aws-lambda'; export const handler: APIGatewayProxyHandler = async (event, context) => { return { statusCode: 200, body: 'Response body' }; }; It ships typed handlers for the common event sources (API Gateway v1/v2, SQS, SNS, S3, DynamoDB streams, scheduled events, etc.).

Use this when you run into the situation in the title.

**When not to use this skill:** unrelated tasks. It covers only the procedure above.

## Compatibility

Tool: aws. The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.

## Details

The split is intentional: client-* packages type the AWS API calls your code makes, aws-lambda types the events AWS sends into your code. If you are typing event as any, you are missing the package.

Context: Stack Overflow #67004778 (accepted answer, 16 votes): a developer moving to AWS SDK v3 for its TypeScript support could not find types for Lambda handler signatures (event, context). The @aws-sdk/client-lambda package only types the management client, not the handler. The verified answer: handler types live in the separate aws-lambda package: import { SQSHandler, SNSHandler, APIGatewayProxyHandler } from 'aws-lambda', e.g. export const handler: APIGatewayProxyHandler = async (event, context) => {...}. One package for calling the Lambda API, another for typing the function itself.
