For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • Configuration
        • AuthHandler
        • ConfigLoader
        • Environment Variables
        • Logging
        • PromptManager
        • SchemaUtils
        • ServerlessAdapter
          • createAzureHandler
          • createGcfHandler
          • createLambdaHandler
          • detectPlatform
          • generateUrl
          • getPlatform
          • handleRequest
        • SessionManager
        • SslConfig
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
      • PomBuilder
      • Prefabs
      • SkillBase
      • SkillManager
      • SkillRegistry
      • Skills
      • SwaigFunction
      • SwmlBuilder
      • SWMLService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • ChatResource
      • Compat
      • Datasphere
      • Fabric
      • ImportedNumbersResource
      • Logs
      • LookupResource
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSubResource
      • Queues
      • Recordings
      • Registry
      • RestClient
      • RestError
      • Short Codes
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Constructor
  • Methods
  • Example
AgentsConfiguration

ServerlessAdapter

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

createAzureHandler

Next
Built with

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.

1import { ServerlessAdapter } from '@signalwire/sdk';
2
3const adapter = new ServerlessAdapter('lambda');
4// or auto-detect from environment variables
5const 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

detectPlatform

Detect the serverless platform from environment variables.

getPlatform

Get the resolved platform identifier.

handleRequest

Route a serverless event through the Hono app.

generateUrl

Generate the platform-specific invocation URL.

createLambdaHandler

Static: Create an AWS Lambda handler from a Hono app.

createGcfHandler

Static: Create a Google Cloud Functions handler from a Hono app.

createAzureHandler

Static: Create an Azure Functions handler from a Hono app.

Example

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