adapter-aws-lambda

Deploy tRPC request handlers to AWS Lambda for API Gateway v1/v2 and Function URLs.

2|Updated Apr 11, 2026
One-click install
npx skills add https://github.com/PlazaCC/antes-da-tela --skill adapter-aws-lambda
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adapter-aws-lambda
Source: https://github.com/PlazaCC/antes-da-tela/tree/main/.agents/skills/adapter-aws-lambda
Command: npx skills add https://github.com/PlazaCC/antes-da-tela --skill adapter-aws-lambda

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill documents how to run tRPC routers and procedures within AWS Lambda environments, handling differences between API Gateway v1 (REST), API Gateway v2 (HTTP), and Lambda Function URLs while enabling response streaming and proper context creation.

Core Features & Use Cases

  • API Gateway compatibility: Examples for using APIGatewayProxyEvent (v1) and APIGatewayProxyEventV2 (v2) payload types with awsLambdaRequestHandler.
  • Streaming support: Guidance for enabling response streaming using awsLambdaStreamingRequestHandler wrapped with awslambda.streamifyResponse for Lambda Function URLs and REST APIs.
  • Batching and limits: Advice on maxBatchSize configuration and client coordination to avoid request rejections, plus a common-mistakes section for routing and batching pitfalls.
  • Use Case: Expose a tRPC backend from a Next.js or Node.js service to serve SPA clients via API Gateway or Lambda Function URLs, including streaming procedures like progress updates or server-sent events.

Quick Start

Expose your tRPC router by creating an AWS Lambda handler using awsLambdaRequestHandler or awsLambdaStreamingRequestHandler wrapped with awslambda.streamifyResponse and a createContext implementation.

Frequently Asked Questions about adapter-aws-lambda

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy tRPC APIs on AWS Lambda?

To deploy tRPC APIs on AWS Lambda, expose your tRPC router by creating a handler using awsLambdaRequestHandler or awsLambdaStreamingRequestHandler, along with a createContext implementation for custom context.

Does tRPC support API Gateway v1 and v2 payloads on Lambda?

Yes, tRPC on Lambda supports API Gateway v1 and v2 payloads. It handles APIGatewayProxyEvent for REST APIs and APIGatewayProxyEventV2 for HTTP APIs using the awsLambdaRequestHandler.

Can I stream tRPC responses from a Lambda Function URL?

Yes, you can stream tRPC responses from a Lambda Function URL. Use the awsLambdaStreamingRequestHandler wrapped with awslambda.streamifyResponse to enable streaming procedures like progress updates or server-sent events.

Why do my batched tRPC requests get rejected on AWS Lambda?

Batched tRPC requests on AWS Lambda get rejected due to payload limits. Configure maxBatchSize and coordinate your client to avoid exceeding request size limitations and prevent routing pitfalls.

What is the best way to serve a SPA client from a Next.js tRPC backend?

The best way to serve a SPA client from a Next.js tRPC backend is deploying the router to AWS Lambda. Expose it via API Gateway or Lambda Function URLs to handle client requests and streaming procedures.