ServerlessAdapter

View as MarkdownOpen in Claude

ServerlessAdapter adapts a Hono application for deployment on AWS Lambda, Google Cloud Functions, Azure Functions, or CGI. It normalizes platform-specific events into standard Request objects, routes them through the Hono app, and returns platform-compatible responses.

import { ServerlessAdapter } from '@signalwire/sdk';
const adapter = new ServerlessAdapter('lambda');
// or auto-detect from environment variables
const autoAdapter = new ServerlessAdapter();

Constructor

platform
ServerlessPlatformDefaults to 'auto'

Target platform. Valid values: "lambda", "gcf", "azure", "cgi", "auto". When "auto", the platform is detected from environment variables.

Methods

Example

import { ServerlessAdapter } from '@signalwire/sdk';
// AWS Lambda deployment
const adapter = new ServerlessAdapter('lambda');
export const handler = (event: any) => adapter.handleRequest(app, event);