> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # ServerlessAdapter > Adapts a Hono application for deployment on AWS Lambda, Google Cloud Functions, Azure Functions, or CGI. `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. ```typescript {3} import { ServerlessAdapter } from '@signalwire/sdk'; const adapter = new ServerlessAdapter('lambda'); // or auto-detect from environment variables const autoAdapter = new ServerlessAdapter(); ``` ## **Constructor** **`platform`** `ServerlessPlatform` — default: 'auto' Target platform. Valid values: `"lambda"`, `"gcf"`, `"azure"`, `"cgi"`, `"auto"`. When `"auto"`, the platform is detected from environment variables. --- ## **Methods** #### [detectPlatform](/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/detect-platform) Detect the serverless platform from environment variables. #### [getPlatform](/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/get-platform) Get the resolved platform identifier. #### [handleRequest](/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/handle-request) Route a serverless event through the Hono app. #### [generateUrl](/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/generate-url) Generate the platform-specific invocation URL. #### [createLambdaHandler](/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/create-lambda-handler) Static: Create an AWS Lambda handler from a Hono app. #### [createGcfHandler](/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/create-gcf-handler) Static: Create a Google Cloud Functions handler from a Hono app. #### [createAzureHandler](/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/create-azure-handler) Static: Create an Azure Functions handler from a Hono app. ## **Example** ```typescript {5} import { ServerlessAdapter } from '@signalwire/sdk'; // AWS Lambda deployment const adapter = new ServerlessAdapter('lambda'); export const handler = (event: any) => adapter.handleRequest(app, event); ``` > Adapts a Hono application for deployment on AWS Lambda, Google Cloud Functions, Azure Functions, or CGI. ## Docs - [createAzureHandler](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/create-azure-handler.md): Create an Azure Functions-compatible handler from a Hono app. - [createGcfHandler](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/create-gcf-handler.md): Create a Google Cloud Functions-compatible handler from a Hono app. - [createLambdaHandler](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/create-lambda-handler.md): Create an AWS Lambda-compatible handler from a Hono app. - [detectPlatform](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/detect-platform.md): Detect the serverless platform from environment variables. - [generateUrl](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/generate-url.md): Generate the platform-specific invocation URL for a deployed function. - [getPlatform](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/get-platform.md): Get the resolved platform identifier. - [handleRequest](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/handle-request.md): Route a serverless event through the Hono app and return a normalized response.