***

title: ServerlessAdapter
slug: /reference/typescript/agents/configuration/serverless-adapter
description: Adapts a Hono application for deployment on AWS Lambda, Google Cloud Functions, Azure Functions, or CGI.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

`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**

<ParamField path="platform" type="ServerlessPlatform" default="'auto'" toc={true}>
  Target platform. Valid values: `"lambda"`, `"gcf"`, `"azure"`, `"cgi"`, `"auto"`.
  When `"auto"`, the platform is detected from environment variables.
</ParamField>

## **Methods**

<CardGroup cols={3}>
  <Card title="detectPlatform" href="/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/detect-platform">
    Detect the serverless platform from environment variables.
  </Card>

  <Card title="getPlatform" href="/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/get-platform">
    Get the resolved platform identifier.
  </Card>

  <Card title="handleRequest" href="/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/handle-request">
    Route a serverless event through the Hono app.
  </Card>

  <Card title="generateUrl" href="/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/generate-url">
    Generate the platform-specific invocation URL.
  </Card>

  <Card title="createLambdaHandler" href="/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/create-lambda-handler">
    Static: Create an AWS Lambda handler from a Hono app.
  </Card>

  <Card title="createGcfHandler" href="/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/create-gcf-handler">
    Static: Create a Google Cloud Functions handler from a Hono app.
  </Card>

  <Card title="createAzureHandler" href="/docs/server-sdks/reference/typescript/agents/configuration/serverless-adapter/create-azure-handler">
    Static: Create an Azure Functions handler from a Hono app.
  </Card>
</CardGroup>

## **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);
```