***

title: getApp
slug: /reference/typescript/agents/agent-base/get-app
description: Get or lazily create the Hono HTTP application with all routes and middleware.
max-toc-depth: 3
---------------------

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

Get the fully initialized Hono application instance. If the app has not been
created yet, this method initializes it with all routes, middleware, health checks,
and security headers -- the same configuration that `serve()` would create.

This is primarily used when embedding the agent in a larger Hono application or
when deploying to serverless platforms.

## **Parameters**

None.

## **Returns**

`Hono` -- The configured Hono application instance with all agent endpoints
registered.

## **Examples**

### Embed in existing Hono app

```typescript {8}
import { Hono } from 'hono';
import { AgentBase } from '@signalwire/sdk';

const mainApp = new Hono();
const agent = new AgentBase({ name: 'assistant', route: '/agent' });
agent.setPromptText('You are a helpful assistant.');

mainApp.route('/ai', agent.getApp());
```

### Use with a custom server

```typescript {7}
import { serve } from '@hono/node-server';
import { AgentBase } from '@signalwire/sdk';

const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
agent.setPromptText('You are a helpful assistant.');

const app = agent.getApp();
serve({ fetch: app.fetch, port: 8080 });
```